Ship meteorological route recommendation method and system based on K-means clustering, and program product
Through the K-means clustering method, local meteorological conditions during ship navigation are clustered and risk assessments are provided, and the visual recommendation of meteorological routes is solved, which is difficult to achieve navigation safety and energy conservation and emission reduction in the existing technology, and more efficient and safe navigation decisions are achieved.
Patent Information
- Application Number
- CN202411820194.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art is difficult to effectively deal with meteorological conditions in local areas during ship navigation, which makes it difficult to achieve navigation safety and energy-saving and emission reduction strategies.
Using the K-means clustering method, through the preprocessing of meteorological data, selection of dangerous meteorological characteristics and cluster generation, dangerous meteorological clustering and navigable meteorological clustering are divided, and visual meteorological route recommendations are provided.
It improves navigation safety and energy conservation and emission reduction effects, reduces calculation volume and rasterized processing steps of navigation areas, and the generated navigation meteorological recommendations are more in line with real-time meteorological conditions and provide more references for navigation decision making.
Smart Images

Figure CN119830048A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of weather routes for ocean-going ships, and more specifically, to a method, system and program product for recommending weather routes for ships based on K-means clustering. Background Art
[0002] During the navigation of a ship, ensuring navigation safety is the top priority, and meteorological factors are one of the key factors affecting navigation safety. On October 1, 2015, the MV El Faro encountered a strong hurricane "Joel" in the waters near the Bahamas, causing the ship to capsize tragically, killing all 33 crew members on board. Although the captain knew about the existence of the hurricane before sailing, he decided to continue sailing due to insufficient assessment of the meteorological conditions. The strong winds and huge waves up to 30 feet brought by the hurricane seriously affected the stability of the ship, and the design defects of the ship made it more likely to capsize in bad weather. In addition, the crew failed to adjust the route in time to avoid the center of the hurricane, revealing the important impact of meteorological conditions on the navigation safety of ships.
[0003] At the same time, with the development of science and technology, the shipping industry is facing increasingly severe environmental challenges. Carbon emissions from ships have exacerbated the problem of global warming, forcing the shipping industry to pay more attention to energy conservation and emission reduction strategies. With the intensification of the global energy crisis, the frequent increase in fuel prices has also significantly increased the operating costs of shipping companies. These factors have jointly promoted the necessity of the shipping industry's transformation to sustainable development.
[0004] In this dual context, the application of ship weather route technology has become an effective way to improve navigation safety and achieve energy conservation and emission reduction. This technology can not only help ships cope with severe weather and improve navigation safety, but also play an important role in reducing carbon emissions caused by meteorological factors. Current research at home and abroad focuses on rasterizing the navigation area and using search algorithms to solve the meteorological route of the entire voyage. The calculation amount is relatively large and the accuracy is low, while there is less research on the meteorological recommendations for ship navigation in local areas. Summary of the invention
[0005] In view of the above-mentioned defects of the prior art, the present invention provides a ship weather route recommendation method, system and program product based on K-means clustering, which can realize the generation of weather recommendations in a small range and provide visual weather route recommendations. When the ship driver cannot completely sail according to the weather route, he can also make his own navigation decision according to the navigation recommendation. Compared with the full-course weather route, the navigation weather route recommendation system can be used both globally and locally, eliminating the step of rasterizing the navigation area and reducing the amount of calculation.
[0006] To achieve the above object, on the one hand, the present invention provides a ship weather route recommendation method based on K-means clustering, comprising the following steps:
[0007] Step 1: Initial meteorological cluster generation
[0008] Step 1.1: Acquisition of meteorological data: Determine the approximate sailing route of the ship, and collect nearby meteorological data including wind speed, wind direction, visibility, air pressure, wave height, wave direction, and wave period according to the location of the ship's route;
[0009] Step 1.2: Data preprocessing: remove data including but not limited to duplicate data, missing values, outliers, and irrelevant feature data, and select normal data that can be clustered for data normalization;
[0010] Step 1.3: Selection of dangerous meteorological features: Collect meteorological data contained in dangerous meteorological conditions that cause ship accidents, use linear regression method to calculate the correlation between these meteorological data and dangerous meteorological conditions, select meteorological features with high correlation, and give these meteorological features their respective weights;
[0011] Step 1.4: Determine clustering parameters: Use the selected meteorological features as the clustering criteria and select the best K value for the data collected in step 1.1;
[0012] Step 1.5: Load the meteorological data collected in step 1.1, and perform K-means clustering according to the clustering criteria and optimal K value of step 1.4 to generate initial meteorological clustering results;
[0013] Step 2: Initial meteorological cluster classification and range calculation
[0014] Step 2.1: Calculate the initial meteorological clustering range based on the average distance from the internal points of the cluster to the cluster center, the maximum distance from the internal points of the cluster to the cluster center, the meteorological characteristics of the cluster center, and the number of internal points of the cluster;
[0015] Step 2.2: Meteorological cluster risk assessment: Calculate the risk level of each initial meteorological cluster according to the meteorological characteristic weight obtained in step 1.3 and the meteorological characteristic value of each initial meteorological cluster center;
[0016] Step 2.3: Meteorological cluster classification: according to the risk level of each initial meteorological cluster obtained in step 2.2, the initial meteorological cluster classification standard is set, and the initial meteorological cluster is classified into dangerous meteorological cluster and navigable meteorological cluster;
[0017] Step 3: Navigation weather recommendations and visualization
[0018] Step 3.1: Divide the risk equipotential lines within the dangerous weather cluster according to the meteorological feature weights obtained in step 1.3, and draw the risk equipotential lines within the dangerous weather cluster using the spatial interpolation method;
[0019] Step 3.2: Perform K-means clustering again on the internal meteorological data of the navigable meteorological cluster, record the meteorological characteristic values of the newly generated cluster center; use the fuel consumption model to solve the recommended heading and speed;
[0020] Step 3.3: Visualize the navigation weather route recommendation with different marks and colors according to the risk contours and recommended heading and speed.
[0021] Furthermore, in step 1.3, the linear regression method uses the Logistic regression method to analyze the meteorological data contained in the collected dangerous meteorological conditions, executes model training and outputs the regression coefficient, p value, and OddsRatio value of each meteorological feature. The correlation between each meteorological feature and dangerous weather is obtained by combining these three parameters, and different weights are given to each meteorological feature according to the level of correlation. The calculation formula is as follows:
[0022] ,
[0023] In the formula, Indicates the probability that the predicted sample belongs to a certain category (such as dangerous weather). represents the linear combination of all features, that is, the linear weighted sum of the features, represents the intercept term, , , Indicates the corresponding features , , The regression coefficient of represents the log-odds function, Indicates the relative probability that an increase in this feature will lead to the occurrence of the target event.
[0024] Furthermore, in step 1.4, the selected meteorological characteristics are used as the clustering standard, and based on the data collected in step 1.1, the Gap statistic method is used to process the pre-processed meteorological data to select the optimal K value for clustering.
[0025] Furthermore, the calculation formula of step 2.1 is:
[0026] ,
[0027] In the formula, represents the radius of the initial meteorological clustering influence range, The average distance The weight coefficient of Indicates the maximum distance The weight coefficient of represents the average distance from the sample points inside the cluster to the cluster center. Indicates The distance from a sample point to the center of the cluster to which it belongs, Indicates the maximum distance from the sample points inside the cluster to the cluster center. represents the location of the cluster center, Indicates The positions of adjacent cluster centers, express and The distance between.
[0028] Furthermore, in step 2.2, the judgment criteria for each meteorological feature are set according to the weight values of the meteorological features obtained in step 1.3 in combination with empirical data, and the meteorological feature values of each meteorological cluster center are compared with the judgment criteria to obtain a risk value.
[0029] Furthermore, in step 3.2, the meteorological data within the navigable meteorological cluster is again subjected to K-means clustering processing, the meteorological characteristic values of the newly generated cluster center are recorded, the recorded meteorological data of the new cluster center are substituted into the wind resistance and wave resistance fuel consumption model for solution, the heading and speed corresponding to the optimal result are saved, and marked in the corresponding cluster range.
[0030] On the other hand, the present invention provides a ship weather route recommendation system based on K-means clustering, which adopts the ship weather route recommendation method as described above to recommend a weather route to a ship, comprising:
[0031] The initial meteorological clustering generation module includes a meteorological data acquisition submodule, a data preprocessing submodule, and a dangerous meteorological feature selection submodule. The selected meteorological features are used as clustering criteria to select the best K value of the collected meteorological data; K-means clustering is performed according to the clustering criteria and the best K value to generate initial meteorological clustering results;
[0032] The initial meteorological cluster classification and range calculation module calculates the initial meteorological cluster range according to the average distance from the internal points of the cluster to the cluster center, the maximum distance from the internal points of the cluster to the cluster center, the meteorological characteristics of the cluster center, and the number of internal points of the cluster; calculates the risk level of each initial meteorological cluster according to the meteorological characteristic weight and the meteorological characteristic value of each initial meteorological cluster center; sets the initial meteorological cluster classification standard according to the risk level of each initial meteorological cluster, and classifies the initial meteorological clusters into dangerous meteorological clusters and navigable meteorological clusters;
[0033] The navigation weather recommendation and visualization module uses the spatial interpolation method to draw the risk equipotential lines within the dangerous weather cluster; performs K-means clustering on the internal meteorological data of the navigable weather cluster again, and records the meteorological characteristic values of the newly generated cluster centers; uses the fuel consumption model to solve the recommended course and speed; and visualizes the navigation weather recommendations with different marks and colors based on the risk equipotential lines and recommended course and speed.
[0034] In a final aspect, the present invention provides a computer program product for recommending ship weather routes; when the computer program product is run on a computer or device, the computer or device executes the ship weather route recommendation method as described above.
[0035] Compared with the prior art, the present invention has the following advantages or beneficial effects:
[0036] Compared with the meteorological route obtained by solving the rasterized ship navigation area with a search algorithm, the present invention uses K-means clustering to avoid rasterizing the navigation area and directly analyze the meteorological data, thereby improving the overall operating efficiency of the system, and directly processing real-time meteorological data to generate navigation meteorological recommendations that are more in line with real-time meteorological conditions. In addition, the navigation meteorological route recommendation method is adopted, which has both global and local navigation recommendations, so that the crew has more options, can adjust the route according to the specific situation, and make navigation decisions more flexibly. The present invention uses K-means clustering to cluster meteorological data, and realizes the visualization of navigation meteorological recommendations through meteorological clustering range determination, risk assessment, classification and meteorological recommendation calculation. The method has the characteristics of wide range, high accuracy, low cost, simplicity and intuitiveness, and provides drivers with more references for navigation decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The present invention and its features and advantages will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings, in which like reference numerals indicate like parts throughout the drawings.
[0038] Figure 1 It is a flow chart of the ship navigation weather recommendation method of the present invention.
[0039] Figure 2 It is a schematic diagram of the initial clustering result of the present invention.
[0040] Figure 3 It is a schematic diagram of the initial meteorological cluster classification result of the present invention.
[0041] Figure 4 The present invention is a schematic diagram of drawing risk equipotential lines based on dangerous weather clustering.
[0042] Figure 5It is a schematic diagram of marking the recommended course and speed based on navigable weather clustering according to the present invention. DETAILED DESCRIPTION
[0043] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.
[0044] The execution order of actions, steps, etc. in the devices and methods shown in the claims, specifications and drawings can be implemented in any order as long as there is no special explicit limitation on the order and as long as the output of the previous processing is not used in the subsequent processing.
[0045] In the following detailed description, many specific details are set forth to provide a more thorough understanding of the present invention. However, it is obvious to those skilled in the art that well-known algorithms and models are not shown in detail to avoid obscuring the subject matter of the present invention.
[0046] Example 1
[0047] This embodiment provides a method for recommending ship weather routes. The flowchart of the method is as follows: Figure 1 As shown, the following steps are included in sequence:
[0048] Step 1: Initial meteorological cluster generation
[0049] Step 1.1: Acquisition of meteorological data. Determine the approximate sailing route of the ship, and collect nearby meteorological data including wind speed, wind direction, visibility, air pressure, wave height, wave direction, and wave period according to the location of the ship's route.
[0050] Step 1.2: Data preprocessing. Remove duplicate data, missing values, outliers, and irrelevant feature data, and filter out normal data that can be clustered for data normalization. Data normalization is a preprocessing technique whose main purpose is to scale data with different features to the same range to eliminate the interference of different dimensions on analysis and modeling. The calculation formula is as follows:
[0051]
[0052] In the formula, Indicates The data point meteorological characteristics; express The normalized value of Representation characteristics The minimum value of Representation characteristics The maximum value of Indicated by The meteorological data matrix is composed of Represents the matrix The elements in are normalized using the minimum and maximum normalization method to obtain the normalized matrix.
[0053] Step 1.3: Selection of dangerous meteorological features. Collect the meteorological data contained in the dangerous meteorological conditions that cause ship accidents, use the linear regression method to calculate the correlation between these meteorological data and dangerous meteorological conditions, select meteorological features with high correlation, and give these meteorological features their own weights. As an example, the linear regression method uses the Logistic regression method to analyze the meteorological data contained in the collected dangerous meteorological conditions, perform model training and output the regression coefficient, p value, and Odds Ratio value of each meteorological feature. Combine these three parameters to derive the correlation between each meteorological feature and dangerous weather, and give each meteorological feature different weights according to the level of correlation. The calculation formula is as follows:
[0054]
[0055] In the formula, Indicates the probability that the predicted sample belongs to a certain category (such as dangerous weather). represents the linear combination of all features, that is, the linear weighted sum of the features, represents the intercept term, , , Indicates the corresponding features , , The regression coefficient of represents the log-odds function, Indicates the relative probability that an increase in this feature will lead to the occurrence of the target event.
[0056] Step 1.4: Determine clustering parameters. Using the selected meteorological features as the clustering criteria, based on the data collected in step 1.1, the Gap statistic method is used to process the pre-processed meteorological data to select the optimal K value for clustering. The calculation formula is as follows:
[0057]
[0058] In the formula, represents the number of clusters, Indicates The number of samples in a cluster, Indicates The center point of the cluster, Indicates The cluster samples, Indicates A random data set The number of samples for each cluster, Indicates A random data set Cluster centers, Indicates A random data set The first cluster samples, represents the number of random data sets generated, The actual data set The closeness of the clustering schemes, Indicates A random data set The compactness of the clustering scheme.
[0059] Step 1.5: Load the meteorological data collected in step 1.1, and perform K-means clustering according to the clustering criteria and optimal K value in step 1.4 to generate initial meteorological clustering results, such as Figure 2 shown.
[0060] Step 2: Initial meteorological cluster classification and range calculation
[0061] Step 2.1: Calculate the initial meteorological clustering range based on the average distance from the internal points of the cluster to the cluster center, the maximum distance from the internal points of the cluster to the cluster center, the meteorological characteristics of the cluster center, and the number of internal points of the cluster. The calculation formula is as follows:
[0062]
[0063] In the formula, represents the radius of the initial meteorological clustering influence range, The average distance The weight coefficient of Indicates the maximum distance The weight coefficient of represents the average distance from the sample points inside the cluster to the cluster center. Indicates The distance from a sample point to the center of the cluster to which it belongs, Indicates the maximum distance from the sample points inside the cluster to the cluster center. represents the location of the cluster center, Indicates The positions of adjacent cluster centers, express and The distance between.
[0064] Step 2.2: Meteorological cluster risk assessment: According to the weight values and empirical data of the meteorological characteristics obtained in step 1.3, set the judgment criteria for each meteorological characteristic, and compare the meteorological characteristic value of each meteorological cluster center with the judgment criteria to obtain the risk value.
[0065] Step 2.3: Meteorological cluster classification. According to the risk level of each initial meteorological cluster obtained in step 2.2, the initial meteorological cluster classification standard is set, and the initial meteorological clusters are classified into dangerous meteorological clusters and navigable meteorological clusters and marked with different colors, such as Figure 3 shown.
[0066] Step 3: Navigation weather recommendations and visualization
[0067] Step 3.1: See Figure 4 , divide the risk equipotential lines within the dangerous weather cluster according to the meteorological feature weights obtained in step 1.3, and use the Kriging spatial interpolation method to draw the risk equipotential lines within the dangerous weather cluster. The calculation formula is as follows:
[0068]
[0069] In the formula, Represents spatial distance, , represents the model parameters, represents the length scale parameter, represents the predicted value of the unknown point, represents the value of a known point, Represents the interpolation weight, which is determined by the minimum mean square error principle.
[0070] Step 3.2: Perform K-means clustering again on the internal meteorological data of the navigable meteorological cluster, record the meteorological characteristic values of the newly generated cluster center, substitute the recorded meteorological data of the new cluster center into the wind resistance and wave resistance fuel consumption model for solution, save the heading and speed corresponding to the optimal result, and mark it in the corresponding cluster range (see Figure 5 ), the fuel consumption model (reference: Liu S, Shang B, Papanikolaou A. On the resistance and speedloss of full type ships in a seaway[J]. Ship technology research, 2019, 66(3): 161-179) formula is as follows:
[0071]
[0072] In the formula, is the resistance received by the ship, represents the additional drag caused by the diffraction effect, represents the additional resistance caused by radiation effects, represents the air density, Indicates the speed of the ship in still water. represents the orthographic projection area of the waterline surface, Indicates the angle between wind direction and bow. represents the density of seawater, : indicates the length of the ship beam, represents the acceleration due to gravity, represents the incident wave amplitude, represents the waterline inlet angle, represents the length between perpendicular lines, represents the wavelength, represents the Froude coefficient, represents the square coefficient, represents the effective encounter frequency of ships, g represents the acceleration of gravity; Represents some parameters determined by ship speed and wave spectrum.
[0073] Step 3.3: Visualize the navigational weather recommendations using different markers and colors based on the risk contours and recommended course and speed.
[0074] From the description of the above specific implementation methods, it can be seen that the ship weather route recommendation method disclosed in the present invention can realize the generation of weather recommendations in a small range, provide visual weather route recommendations, and when the ship driver cannot completely sail according to the weather route, he can also make his own navigation decision based on the navigation recommendation. Compared with the full-course weather route, the navigation weather route recommendation system can be used both globally and locally, eliminating the step of rasterizing the navigation area and reducing the amount of calculation.
[0075] The above-mentioned ship weather route recommendation method can be embodied in the form of a computer program product or a software functional unit. If the above-mentioned basic visual question answering model and its training method are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. When the computer program product is run on a computer or device, the computer or device executes the above-mentioned ship weather route recommendation method.
[0076] Example 2
[0077] This embodiment provides a ship weather route recommendation system based on K-means clustering, which uses the ship weather route recommendation method described in Embodiment 1 to recommend a weather route to a ship, including:
[0078] The initial meteorological clustering generation module includes a meteorological data acquisition submodule, a data preprocessing submodule, and a dangerous meteorological feature selection submodule. The selected meteorological features are used as clustering criteria to select the best K value of the collected meteorological data; K-means clustering is performed according to the clustering criteria and the best K value to generate initial meteorological clustering results;
[0079] The initial meteorological cluster classification and range calculation module calculates the initial meteorological cluster range according to the average distance from the internal points of the cluster to the cluster center, the maximum distance from the internal points of the cluster to the cluster center, the meteorological characteristics of the cluster center, and the number of internal points of the cluster; calculates the risk level of each initial meteorological cluster according to the meteorological characteristic weight and the meteorological characteristic value of each initial meteorological cluster center; sets the initial meteorological cluster classification standard according to the risk level of each initial meteorological cluster, and classifies the initial meteorological clusters into dangerous meteorological clusters and navigable meteorological clusters;
[0080] The navigation weather recommendation and visualization module uses the spatial interpolation method to draw the risk equipotential lines within the dangerous weather cluster; performs K-means clustering on the internal meteorological data of the navigable weather cluster again, and records the meteorological characteristic values of the newly generated cluster centers; uses the fuel consumption model to solve the recommended course and speed; and visualizes the navigation weather recommendations with different marks and colors based on the risk equipotential lines and recommended course and speed.
[0081] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0082] In summary, the present invention discloses a ship weather route recommendation method, system and program product based on K-means clustering, firstly, the meteorological data is screened for correlation with dangerous weather characteristics, and meteorological characteristics with high correlation with dangerous weather are selected, and different weights are given according to the correlation with dangerous weather, and then the collected meteorological data is K-means clustered according to the selected meteorological characteristics to generate initial meteorological clusters, and then the scope and risk level of the meteorological clusters are calculated according to the internal point position, distance, meteorological characteristics and weights of the meteorological clusters, and the initial meteorological clusters are divided into two types: navigable meteorological clusters and dangerous meteorological clusters, and finally, energy-saving navigation recommendations are generated based on the functionality of navigable meteorological clusters to reduce the fuel consumption of ships caused by meteorological resistance, and risk equipotential lines are generated based on the early warning of dangerous meteorological clusters to inform the crew of the risk situation in the area where they are located. The present invention has the characteristics of wide range, high accuracy, low cost, simplicity and intuition, and provides more references for navigation decisions for drivers.
[0083] Those skilled in the art should understand that those skilled in the art can implement variations in combination with the prior art and the above embodiments, which will not be described in detail here. Such variations do not affect the essential content of the present invention and will not be described in detail here. Any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
Claims
1. A ship weather route recommendation method based on K-means clustering, characterized in that: The following steps are involved: Step 1: Initial meteorological cluster generation Step 1.1: Acquisition of meteorological data: Determine the approximate sailing route of the ship, and collect nearby meteorological data including wind speed, wind direction, visibility, air pressure, wave height, wave direction, and wave period according to the location of the ship's route; Step 1.2: Data preprocessing: remove data including but not limited to duplicate data, missing values, outliers, and irrelevant feature data, and select normal data that can be clustered for data normalization; Step 1.3: Selection of dangerous meteorological features: Collect meteorological data contained in dangerous meteorological conditions that cause ship accidents, use linear regression method to calculate the correlation between these meteorological data and dangerous meteorological conditions, select meteorological features with high correlation, and give these meteorological features their respective weights; Step 1.4: Determine clustering parameters: Use the selected meteorological features as the clustering criteria and select the best K value for the data collected in step 1.1; Step 1.5: Load the meteorological data collected in step 1.1, and perform K-means clustering according to the clustering criteria and optimal K value of step 1.4 to generate initial meteorological clustering results; Step 2: Initial meteorological cluster classification and range calculation Step 2.1: Calculate the initial meteorological clustering range based on the average distance from the internal points of the cluster to the cluster center, the maximum distance from the internal points of the cluster to the cluster center, the meteorological characteristics of the cluster center, and the number of internal points of the cluster; Step 2.2: Meteorological cluster risk assessment: Calculate the risk level of each initial meteorological cluster according to the meteorological characteristic weight obtained in step 1.3 and the meteorological characteristic value of each initial meteorological cluster center; Step 2.3: Meteorological cluster classification: according to the risk level of each initial meteorological cluster obtained in step 2.2, the initial meteorological cluster classification standard is set, and the initial meteorological cluster is classified into dangerous meteorological cluster and navigable meteorological cluster; Step 3: Navigation weather recommendations and visualization Step 3.1: Divide the risk equipotential lines within the dangerous weather cluster according to the meteorological feature weights obtained in step 1.3, and draw the risk equipotential lines within the dangerous weather cluster using the spatial interpolation method; Step 3.2: Perform K-means clustering again on the internal meteorological data of the navigable meteorological cluster, record the meteorological characteristic values of the newly generated cluster center; use the fuel consumption model to solve the recommended heading and speed; Step 3.3: Visualize the navigation weather route recommendation with different marks and colors according to the risk contours and recommended heading and speed.
2. A ship weather route recommendation method based on K-means clustering according to claim 1, characterized in that: In step 1.3, the linear regression method uses the Logistic regression method to analyze the meteorological data contained in the collected dangerous meteorological conditions, executes model training and outputs the regression coefficient, p value, and Odds Ratio value of each meteorological feature. The correlation between each meteorological feature and dangerous weather is obtained by combining these three parameters, and different weights are given to each meteorological feature according to the level of correlation. The calculation formula is as follows: , In the formula, Indicates the probability that the predicted sample belongs to a certain category (such as dangerous weather). represents the linear combination of all features, that is, the linear weighted sum of the features, represents the intercept term, , , Indicates the corresponding features , , The regression coefficient of represents the log-odds function, Indicates the relative probability that an increase in this feature will lead to the occurrence of the target event.
3. The ship weather route recommendation method based on K-means clustering according to claim 1, characterized in that: In the step 1.4, the selected meteorological characteristics are used as the clustering standard, and based on the data collected in the step 1.1, the Gap statistic method is used to process the pre-processed meteorological data to select the optimal K value for clustering.
4. The ship weather route recommendation method based on K-means clustering according to claim 1, characterized in that: The calculation formula of step 2.1 is: , In the formula, represents the radius of the initial meteorological clustering influence range, The average distance The weight coefficient of Indicates the maximum distance The weight coefficient of represents the average distance from the sample points inside the cluster to the cluster center. Indicates The distance from a sample point to the center of the cluster to which it belongs, Indicates the maximum distance from the sample points inside the cluster to the cluster center. represents the location of the cluster center, Indicates The positions of adjacent cluster centers, express and The distance between.
5. The ship weather route recommendation method based on K-means clustering according to claim 1, characterized in that: In step 2.2, according to the weight values and empirical data of the meteorological characteristics obtained in step 1.3, the judgment criteria for each meteorological characteristic are set, and the meteorological characteristic value of each meteorological cluster center is compared with the judgment criteria to obtain the risk value.
6. The ship weather route recommendation method based on K-means clustering according to claim 1, characterized in that: In step 3.2, the meteorological data within the navigable meteorological cluster is again subjected to K-means clustering processing, the meteorological characteristic values of the newly generated cluster center are recorded, the recorded meteorological data of the new cluster center are substituted into the wind resistance and wave resistance fuel consumption model for solution, the heading and speed corresponding to the optimal result are saved, and marked in the corresponding cluster range.
7. A ship weather route recommendation system based on K-means clustering, characterized in that: The method for recommending a weather route for a ship according to any one of claims 1 to 6 is used to recommend a weather route to a ship, comprising: The initial meteorological clustering generation module includes a meteorological data acquisition submodule, a data preprocessing submodule, and a dangerous meteorological feature selection submodule. The selected meteorological features are used as clustering criteria to select the best K value of the collected meteorological data; K-means clustering is performed according to the clustering criteria and the best K value to generate initial meteorological clustering results; The initial meteorological cluster classification and range calculation module calculates the initial meteorological cluster range according to the average distance from the internal points of the cluster to the cluster center, the maximum distance from the internal points of the cluster to the cluster center, the meteorological characteristics of the cluster center, and the number of internal points of the cluster; calculates the risk level of each initial meteorological cluster according to the meteorological characteristic weight and the meteorological characteristic value of each initial meteorological cluster center; sets the initial meteorological cluster classification standard according to the risk level of each initial meteorological cluster, and classifies the initial meteorological clusters into dangerous meteorological clusters and navigable meteorological clusters; The navigation weather recommendation and visualization module uses the spatial interpolation method to draw the risk equipotential lines within the dangerous weather cluster; performs K-means clustering on the internal meteorological data of the navigable weather cluster again, and records the meteorological characteristic values of the newly generated cluster centers; uses the fuel consumption model to solve the recommended course and speed; and visualizes the navigation weather recommendations with different marks and colors based on the risk equipotential lines and recommended course and speed.
8. A computer program product, characterized in that Used for ship weather route recommendation; when the computer program product runs on a computer or device, the computer or device executes the ship weather route recommendation method as described in any one of claims 1 to 6.