Ship track generation method based on STK and MATLAB combined simulation
By using STK and MATLAB for joint simulation, high-precision ship tracks are generated, solving the problems of incomplete data, low update frequency, high cost and insufficient simulation accuracy in existing technologies, and realizing flexible and reliable track data acquisition and analysis.
Patent Information
- Application Number
- CN202510004608.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-01-02
AI Technical Summary
Existing track data acquisition suffers from problems such as incomplete data, low update frequency, high acquisition cost, and insufficient security and privacy, especially in the open ocean and polar waters where coverage is difficult. Furthermore, existing simulation methods lack flexibility, have low simulation accuracy, and are difficult to extract data.
Using STK and MATLAB co-simulation, a ship model is generated by setting a random seed, and a track is generated by interpolation and random offset. Combined with data extraction and visualization modules, high-precision and flexible track generation is achieved.
It improves the comprehensiveness, timeliness, and security of track data, enhances the reliability and ease of operation of simulation results, and is suitable for maritime traffic simulation, shipping route planning, and marine safety analysis.
Smart Images

Figure CN120068382B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of ship track simulation and generation, in particular to a high-precision ship track generation method based on STK and MATLAB joint simulation, and simultaneously relates to a corresponding ship track generation system, a computer terminal and a computer readable storage medium. BACKGROUND
[0002] Among the existing ship track data acquisition methods, the Automatic Identification System (AIS) is widely used for broadcasting real-time position, heading and speed information of ships. Data is collected through land-based stations and satellite receiving stations, and widely distributed through multiple data provider service platforms such as MarineTraffic and VesselFinder. In addition, satellite remote sensing technology, including optical satellites and Synthetic Aperture Radar (SAR) satellites, is used for ship position detection under various weather conditions, and the data is obtained through commercial satellite companies or government agencies. Government and maritime organizations also provide ship entry and exit port information and navigation announcements, while the Long Range Identification and Tracking (LRIT) system is used to meet international safety requirements. Commercial data analysis services provide ship tracking and analysis services by integrating multiple data sources, while research institutions and cooperative projects support scientific research activities through data sharing and open datasets. Although existing technologies can meet market demand to some extent, there are still deficiencies in the comprehensiveness of data coverage, update frequency, acquisition cost, privacy and security. In particular, in complex sea areas such as the open ocean and polar regions, extreme environmental conditions increase the difficulty of data collection. These limitations indicate the need to develop new methods to improve the efficiency and quality of ship track data acquisition, while reducing the risk of relying on external data sources and ensuring the privacy and security of track data.
[0003] Currently, the acquisition of track data mainly faces the following problems:
[0004] The main problems of track data acquisition include data incompleteness, low update frequency, and high data acquisition cost. Especially in the vast ocean and polar sea areas, traditional monitoring technologies such as AIS and satellite remote sensing are often limited by technical and environmental factors, resulting in delayed data updates and incomplete coverage. In addition, although commercial and government platforms can provide a large amount of data, access to these data is often accompanied by high costs and complex legal regulations, especially those related to ship privacy and international security. Data security and privacy protection are also a major concern, as unauthorized data access and use can lead to serious security risks and privacy breaches. Therefore, there is an urgent need to develop a more economical, efficient and secure ship track data acquisition technology to overcome the limitations of existing technologies, provide more comprehensive, timely and reliable ship track information, especially in areas that are difficult to cover due to technical and environmental factors, and lack a ship track data acquisition technology that can effectively solve the cost problem of data acquisition while ensuring the comprehensiveness, timeliness and security of data to support maritime safety, ocean management and scientific research and other needs.
[0005] In addition, the existing track simulation method also has a series of technical problems, which further limits its application in high-precision scenarios. First, the simulation results are not easy to reproduce, and there are many random factors in the current system, making it difficult to obtain stable simulation results with consistent input conditions, which affects the repeatability of the experiment. Second, the lack of flexibility limits users from adjusting ship types, track generation areas and other parameters according to their needs, resulting in poor adaptability of the simulation system in different application scenarios. Third, the simulation accuracy is not high, which is an important defect of the existing technology. The existing simulation system cannot provide high enough spatial and temporal accuracy in handling complex sea areas and multi-ship interactions, affecting the reliability of the results. Finally, the problem of difficult data extraction and processing is also very prominent. The extraction and subsequent analysis steps of track data in the existing system are cumbersome, and there is a lack of effective tool support, which limits the application of simulation results in practice. SUMMARY
[0006] In view of the above deficiencies in the prior art, the purpose of the present application is to provide a high-precision ship track generation method based on STK and MATLAB joint simulation, and a corresponding ship track generation system for generating ship track information.
[0007] The present application is realized by the following technical solutions.
[0008] According to one aspect of the present application, a ship track generation method based on STK and MATLAB joint simulation is provided, characterized in that it comprises:
[0009] Setting random seed and initializing STK environment through MATLAB, loading the set simulation scene;
[0010] In the simulation scene, randomly selecting the ship model to be simulated, and setting the corresponding type, attribute and speed for each ship model;
[0011] Generating the starting point and the ending point of each ship model by using random algorithm, generating continuous and diverse path points by using interpolation method, and updating the track of the ship model in real time through dynamic propagation of path points.
[0012] Preferably, the above method further comprises any one or any multiple of the following:
[0013] Extracting state data from each ship model and outputting all data to a CSV file for subsequent analysis and application;
[0014] Displaying the driving track of the ship through the visualization module of STK.
[0015] According to another aspect of the present application, a ship track generation system based on STK and MATLAB joint simulation is provided, comprising:
[0016] A scene setting module for setting random seed and initializing STK environment for loading the set simulation scene;
[0017] A model selection module for randomly selecting the ship model to be simulated in the simulation scene, and setting the corresponding type, attribute and speed for each ship model;
[0018] A path generation module for generating the starting point and the ending point of each ship model by using random algorithm, generating continuous and diverse path points by using interpolation method, and updating the track of the ship model in real time through dynamic propagation of path points.
[0019] Preferably, the above system further comprises any one or any multiple of the following modules:
[0020] A data storage module for extracting state data from each ship model and outputting all data to a CSV file for subsequent analysis and application;
[0021] A visualization display module for displaying the driving track of the ship through the visualization module of STK.
[0022] According to a third aspect of the present application, there is provided a computer terminal comprising a memory, a processor and a computer program stored on the memory and loadable on the processor, the processor being arranged to execute the computer program to perform the method according to the first aspect of the present application or to run the system according to the second aspect of the present application.
[0023] According to a fourth aspect of the present application, there is provided a computer readable storage medium having stored thereon a computer program, the computer program being loadable on a processor and arranged to perform the method according to the first aspect of the present application or to run the system according to the second aspect of the present application when executed by the processor.
[0024] Thanks to the above technical solutions, the present application has at least one of the following beneficial effects compared with the prior art:
[0025] The present application enhances the flexibility and expansibility of the method by predefining multiple types of ship models and attributes, which can be flexibly adjusted according to the requirements of users.
[0026] The present application significantly improves the simulation accuracy of ship tracks and the matching degree with real scenes by generating path points using linear interpolation and random offsets.
[0027] The present application efficiently extracts and outputs simulation data by means of the data provider function of STK, increases the convenience of data analysis and processing by combining MATLAB with STK, is easy to operate, reduces the difficulty of use, and is convenient for popularization and application.
[0028] The present application overcomes the problems of the prior art such as difficulty in reproducing simulation results, insufficient flexibility, low simulation accuracy, and difficulty in data extraction, and realizes an efficient, reliable, flexible and accurate multi-ship track simulation technology, which has significant technical progress and practical value. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The figure is a workflow diagram of the ship track generation method based on the joint simulation of STK and MATLAB in a preferred embodiment of the present application.
[0030] Figure 2 The figure is a general flowchart of the ship track generation method based on the joint simulation of STK and MATLAB in a specific application example of the present application.
[0031] Figure 3 The figure is a visualization diagram of the track in a 20km*20km scene in a specific application example of the present application.
[0032] Figure 4 The figure is a visualization diagram of the track in a 10km*10km scene in a specific application example of the present application.
[0033] Figure 5It is a visualization diagram of the track in a 5km*5km scene in a specific application example of the present application.
[0034] Figure 6 The intended composition module of the ship track generation system based on the joint simulation of STK and MATLAB in the preferred embodiment of the present application is. DETAILED DESCRIPTION
[0035] The embodiments of the present application are described in detail below: The embodiments are implemented on the premise of the technical solutions of the present application, and detailed implementation manners and specific operation processes are given. It should be noted that, for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application.
[0036] In order to realize a more economical, efficient and safe ship track data acquisition technology, an embodiment of the present application provides a ship track generation method based on the joint simulation of STK and MATLAB. The method combines the visualization and simulation capabilities of STK with the efficient calculation and data processing functions of MATLAB, and realizes a high-precision and real-time ship track generation solution.
[0037] Specifically, as shown in the embodiment, the ship track generation method based on the joint simulation of STK and MATLAB can include the following operations: Figure 1
[0038] S1, setting a random seed, initializing the STK environment through MATLAB, and loading the set simulation scene;
[0039] S2, randomly selecting a ship model to be simulated in the simulation scene, and setting the type, attribute and speed of each ship model;
[0040] S3, generating the starting point and ending point of each ship model using a random algorithm, generating a plurality of continuous path points using an interpolation method, and updating the track of the ship model in real time through dynamic propagation of the path points.
[0041] In some preferred embodiments, the above S1, setting a random seed, initializing the STK environment through MATLAB, and loading the set simulation scene, can further include the following operations:
[0042] S11, setting a random number generator to ensure that the ship track data generated each time can be reproduced;
[0043] S12, starting the STK application by actxserver command in MATLAB, creating a simulation scene in STK, setting the time format of the simulation scene, and specifying the time range and analysis start time to ensure that the time frame of the ship track simulation meets the expectations.
[0044] In some preferred embodiments, S2, randomly selecting ship models to be simulated, and setting the type, attributes and speed of each ship model, can further include the following operations:
[0045] S21, selecting the required models from the preset ship model library, including aircraft carrier models, cruise ship models, destroyer models and small cargo ship models, and storing the paths of these ship model files and the corresponding type names;
[0046] S22, according to the specified number of ship models to be simulated, creating each ship model in a loop, and setting the type, speed and attributes of the ship model according to the randomly selected ship model file.
[0047] In some preferred embodiments, S3, using a random algorithm to generate the starting point and ending point of each ship model, can further include the following operations:
[0048] S31, defining a region as the simulation area for ship models to navigate using geographic coordinates;
[0049] S32, generating the starting point coordinates of the ship model randomly in the simulation area using a random algorithm, and generating an ending point coordinate with a certain distance from the starting point coordinate according to the set distance range, thereby determining the starting point and ending point of the ship model.
[0050] In some preferred embodiments, S3, using interpolation method to generate continuous and diverse path points, and updating the track of the ship model in real time by dynamically propagating the path points, can further include the following operations:
[0051] S33, according to the randomly generated starting point and ending point of the ship model, obtaining multiple path points for simulating the ship model's navigation trajectory by linear interpolation, and generating random offsets for adding between the path points to obtain continuous and diverse ship model navigation path points;
[0052] S34, setting the navigation path points for each ship model and propagating the path step by step to dynamically generate the track for the ship model to navigate.
[0053] In some preferred embodiments, S33, according to the starting point and the ending point of the randomly generated ship model, obtains a plurality of path points for simulating the sailing trajectory of the ship model by linear interpolation, and generates a random offset for adding between the path points to obtain a continuous and diverse sailing path point of the ship model, and can further include the following operations:
[0054] S321, according to the starting point and the ending point of the ship model, obtains path points by linear interpolation:
[0055]
[0056]
[0057] wherein (lat1,lon1) and (lat2,lon2) are the starting point and the ending point of the ship model respectively, n is the number of segments, (lat i ,lon i ) is the position of the i-th coordinate;
[0058] S322, the random offset Δlat i and Δlon i generated and added between the path points are:
[0059] Δlat i = (rand-0.5) x 2δ lat
[0060] Δlon i = (rand-0.5) x 2δ lon
[0061] wherein rand is a uniform random number generated in the interval [0,1), and δ lat and δ ioi are the maximum offset of latitude and the maximum offset of longitude;
[0062] S323, the random offset Δlat i and Δlon i are added to the original path point coordinates to obtain:
[0063] lat′ i = lat i + Δlat i
[0064] lon′ i = lon i + Δlon i
[0065] wherein (lon′ i ,lon′ i) is the i-th point in the obtained navigation path point.
[0066] In some preferred embodiments, the method described above can further include any one or more of the following operations:
[0067] S4, extracting state data from each ship model and outputting all data to a CSV file for subsequent analysis and application;
[0068] S5, displaying the ship's travel trajectory through the visualization module provided by STK.
[0069] In some preferred embodiments, S5 described above, extracting state data from each ship model and outputting all data to a CSV file, can further include the following operations:
[0070] S51, extracting state data from each ship model, including time, longitude, latitude, heading and speed information;
[0071] S52, formatting the extracted state data into a standard time format and storing it in a data table to obtain all data;
[0072] S53, outputting all data to a CSV file.
[0073] The technical solutions provided by the above embodiments of the application will be further described in detail below in conjunction with a specific application example.
[0074] The specific application example is based on the ship track generation method provided by the above embodiments, and the overall architecture includes the following 5 steps:
[0075] Step S1, scene setting: ensure the reproducibility of the trajectory by setting a random seed, and initialize the STK environment to load a specific simulation scene.
[0076] Step S2, set the ship model file and properties: in the ship model configuration stage, randomly select multiple ship models and set the corresponding properties and speed for each ship.
[0077] Step S3, ship track generation: generate the starting point and ending point of the ship using a random algorithm, and generate path points using an interpolation method to ensure the continuity and diversity of the path. Update the ship's track in real time by dynamically propagating the path points.
[0078] Step S4, simulation data extraction and saving: extract state data from each ship to build a comprehensive data table, and output all data to a CSV file for subsequent analysis and application.
[0079] Step S5, visual display: the ship's travel trajectory can be displayed through the visualization module of STK software.
[0080] The technical solutions of the specific application examples are further described in detail below in combination with the drawings and experimental examples.
[0081] As shown in the overall flowchart of the ship track generation method. Figure 2
[0082] I. The detailed steps of the scene setting are as follows:
[0083] (1) Set the random number generator to ensure that the trajectory is reproducible
[0084] In order to ensure the reproducibility of the ship track data generated by each simulation, first set the seed value of the random number generator. For example, the seed value can be set to 42 to ensure that the order of random number generation is consistent at each run of the simulation, so that the initial position, speed and path of the ship and other random parameters are reproducible.
[0085] (2) Start the STK application and create a new scene
[0086] Start the STK application through the actxserver command in MATLAB to run it in visible mode. Then, create a new scene in STK, set the time format of the scene to UTCG, and specify the time range of the scene. At the same time, set the start time of the analysis and the step type of the animation to facilitate subsequent simulation operations.
[0087] In order to analyze the effects of different density of ship activities, the following three scenarios are designed:
[0088] (1) Sparse distribution scenario
[0089] One ship is arranged in each 20km x 20km square grid. This scenario simulates the case of less traffic activity in the sea area, which is suitable for studying the traffic pattern in the case of peace time, limited resources or less ship activity. Through this sparse distribution, the ship's route planning, communication and resource coverage in low density can be evaluated.
[0090] (2) Medium density scenario
[0091] One ship is deployed in each 10km x 10km grid. This scenario represents a more common ship density, which is suitable for studying traffic scheduling in an environment where merchant ship activity is frequent but has not yet reached high density pressure. The arrangement of medium density helps to analyze the cooperation, collision avoidance mechanism between ships, and the reliability of network communication and navigation under this density.
[0092] (3) High density scenario
[0093] One ship is placed within every 5km x 5km grid, simulating a high concentration of ships. This scenario is commonly used to study peak maritime traffic, such as wartime ship concentrations, dense commercial shipping, or large-scale rescue operations. In high-density scenarios, the focus is on analyzing collision risks between ships, signal interference, route planning efficiency, and the performance of multi-ship communication networks in crowded conditions.
[0094] II. Detailed steps for setting up ship model files and attributes are as follows:
[0095] (1) Define ship model files and types
[0096] Prepare multiple types of ship model files from the preset ship model library, such as aircraft carriers, cruise ships, destroyers, and small cargo ships. Define and store the paths of these model files and their corresponding type names for subsequent random selection.
[0097] (2) Define the area for generating flight paths
[0098] Determine the simulation area for ship navigation, using geographic coordinates (latitude and longitude) to define an area that will be used to randomly generate the starting and ending points of the ship's flight path, ensuring that the ship's flight path is within the specified simulation range.
[0099] III. Detailed steps for generating ship flight paths are as follows:
[0100] (1) Set the number of ships
[0101] Specify the number of ships to be simulated, for example, 30. This number can be adjusted according to actual needs.
[0102] (2) Loop to create and configure each ship
[0103] For each ship, perform the following steps:
[0104] a. Create a ship object and name it
[0105] Use numbers to name the ship, such as "Ship_1", "Ship_2", etc., to facilitate identification and management. In the STK scenario, create the corresponding ship object and ensure that it is visible in the simulation interface.
[0106] b. Randomly select a ship model and type
[0107] Randomly select a model file from the STK-provided ship model files and assign it to the current ship object. At the same time, obtain the corresponding ship type to set specific attributes based on the type.
[0108] c. Set speed and attributes based on ship type
[0109] Different types of ships have different speed ranges and attributes. For example:
[0110] · Aircraft carrier and destroyer: speed range 55-65 km / h, attribute "military".
[0111] · Cruise ship: speed range 37-46 km / h, attribute "civilian".
[0112] · Small cargo ship: speed range 22-37 km / h, attribute "civilian".
[0113] According to the randomly selected ship type, set its speed (and convert to per second unit) and military or civilian attribute.
[0114] d. Randomly generate start and end points
[0115] Randomly generate the start coordinates (latitude and longitude) of the ship within the defined navigation area. Then, generate an end point coordinate with a certain distance from the start point, ensuring that the ship has a reasonable navigation path.
[0116] e. Generate path points and add random offset
[0117] In order to simulate the actual navigation path of the ship, generate several path points so that the ship travels from the start point to the end point. The latitude and longitude of these path points can be obtained by linear interpolation between the start and end points. In order to increase the diversity of the path, a certain random offset is added to the coordinates of each path point.
[0118] f. Add path points and propagate route
[0119] Add the generated path points to the ship's route (Route). For each path point, set its latitude, longitude, altitude and speed, etc. After adding each path point, perform the Propagate operation to update the ship's route.
[0120] g. Exception handling
[0121] During the propagation of the route, it may encounter situations that cannot be propagated, such as unreasonable path point settings. Through the exception handling mechanism, capture and record the information of the propagation error, so as to adjust and optimize.
[0122] The algorithm flow of ship track generation is as follows:
[0123]
[0124] Four, simulation data extraction and saving:
[0125] (1) Extracting position, time and heading data
[0126] Using the data interface of STK (Data Providers), extract the latitude, longitude, time and azimuth data of the ships within the simulation time range.
[0127] (2) Format and store data
[0128] Format the extracted time data into a standard date and time format. Create a data table for each ship, containing information such as ship name, time, latitude, longitude, heading, speed and attributes.
[0129] (3) Aggregate data for all ships
[0130] Combine the data tables for each ship to form a total table containing all simulation data for all ships, facilitating subsequent data analysis and processing.
[0131] (4) Output all ship data to a file
[0132] Output the aggregated simulation data for all ships to a CSV file, which can be used for subsequent data analysis, visualization or other applications.
[0133] (5) To further improve the quality of simulation results, the invention provides suggestions for post-processing of simulation data after data extraction and output, including data smoothing, outlier processing and other methods to ensure data accuracy and reliability.
[0134] a. Data smoothing, during the simulation process, the speed, heading and other data of the ships may have small random fluctuations. To reduce the impact of these fluctuations on the analysis results, the extracted track data can be smoothed. Common methods include moving average, exponential smoothing, filtering, etc.
[0135] b. Outlier processing, simulation data may contain outliers due to abnormal propagation or random factors, which may affect the analysis results. Processing methods include statistical detection, data correction, and outlier rejection.
[0136] Five, data visualization display
[0137] STK software provides track line display function, time control toolbar (Time Control Toolbar), used to control the playback of scene animation, simulation data visualization as shown in Figures 3-5 , showing the track of 30 ships.
[0138] Six, verification analysis of simulation data
[0139] Three different types of ship models (small speedboat, commercial cargo ship and large aircraft carrier) are selected to simulate the navigation from the starting point to the destination in the predefined southeast China sea environment. Each ship is set according to its specific physical characteristics and dynamic parameters, and the actual marine environmental factors such as wind speed, sea current and weather conditions are considered to add errors to the parameters during the simulation process. Table 1 shows part of the aircraft carrier's track data:
[0140] Table 1
[0141]
[0142] The track data generated by STK and MATLAB includes navigation time, track coordinates, speed and heading changes, etc. After collecting these data, MATLAB is used for subsequent data processing and analysis, including track smoothness, speed consistency and statistical analysis of yaw angle, as shown in Table 2:
[0143] Table 2
[0144] Ship type Position error Time matching error Speed error Maximum deviation distance Experiment 1 1.4383260 0.1587129 0.1369887 2.1329625 Experiment 2 0.9515514 0.1855630 0.2462201 4.4884164 Experiment 3 1.2659937 0.1966086 0.4004708 1.8786506
[0145] By analyzing the indicators of the simulation method, it can be seen that the method has good accuracy and stability in many key aspects. First, the average position error is 1.31, and the standard deviation is 0.28, indicating that the simulation trajectory has a small difference and small fluctuation in space compared to the real trajectory, indicating that the simulation method has good spatial accuracy. The average time matching error is 0.16, and the standard deviation is 0.036, indicating good consistency in time. The average speed error is 0.29, indicating that the simulation trajectory is close to the real one in dynamic characteristics, and the standard deviation is only 0.12, showing high stability. The average maximum deviation distance is 2.56, and the standard deviation is 1.23, indicating that the local deviation is small. Therefore, by comprehensively analyzing the indicators, it can be concluded that the simulation method has high reliability in space, time, dynamic characteristics and trajectory shape, proving its effectiveness.
[0146] In summary, the high-precision ship track generation method based on STK and MATLAB joint simulation provided by the above embodiments of the present application successfully simulates the navigation of multiple ships in a specified area by setting a random number generator, defining ship models and attributes, simulating the navigation paths of multiple ships, and extracting and outputting simulation data. This method can be used in maritime traffic simulation, shipping route planning, marine safety analysis and other fields, and has important application value.
[0147] Based on the same inventive concept, an embodiment of the present application also provides a ship track generation system based on STK and MATLAB joint simulation.
[0148] Specifically, as shown in the embodiment, the ship track generation system based on the joint simulation of STK and MATLAB can include the following modules: Figure 6
[0149] A scene setting module is configured to set a random seed and initialize an STK environment for loading a set simulation scene.
[0150] A model selection module is configured to randomly select a ship model to be simulated in the simulation scene and set a corresponding type, attribute and speed for each ship model.
[0151] A path generation module is configured to generate a starting point and an ending point for each ship model by using a random algorithm, generate a plurality of continuous path points by using an interpolation method, and update a track of the ship model in real time by dynamically propagating the path points.
[0152] In some preferred embodiments, the system can further include any one or more of the following modules:
[0153] A data storage module is configured to extract state data from each ship model and output all the data to a CSV file for subsequent analysis and application.
[0154] A visual display module is configured to display a ship track by using a visual module provided by STK.
[0155] It should be noted that the steps in the method provided by the present application can be implemented by using corresponding components in the system, and a person skilled in the art can refer to the technical solution of the system to implement the step flow of the method, or refer to the technical solution of the method to implement the components of the system, that is, the embodiments in the system and the embodiments in the method can be understood as preferred examples, and will not be described here.
[0156] An embodiment of the present application further provides a computer terminal including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the computer program to execute the method of any one of the above-mentioned embodiments of the present application, or run the system of any one of the above-mentioned embodiments of the present application.
[0157] Optionally, a memory for storing programs; the memory can include volatile memory (e.g., random-access memory (RAM) such as static random-access memory (SRAM), Double Data Rate SDRAM (DDR SDRAM), and so on) and / or non-volatile memory (e.g., flash memory). The memory is used to store computer programs (e.g., application programs, functional modules, and so on that implement the above-described methods), computer instructions, and so on. The above-described computer programs, computer instructions, and so on can be stored in one or more memories in a partitioned manner. The above-described computer programs, computer instructions, data, and so on can be invoked by the processor.
[0158] A processor for executing the computer programs stored in the memory to implement the various steps in the methods or the various modules of the systems according to the above-described embodiments. Details can be referred to the related descriptions in the above-described method and system embodiments.
[0159] The processor and the memory can be independent structures or integrated structures. When the processor and the memory are independent structures, the memory and the processor can be coupled by a bus.
[0160] An embodiment of the present application further provides a computer readable storage medium, which has stored thereon a computer program. The computer program is executed by a processor to implement the method of any one of the above-described embodiments of the present application or to run the system of any one of the above-described embodiments of the present application.
[0161] The computer readable medium includes a computer storage medium and a communication medium. The communication medium includes any medium that facilitates transfer of a computer program from one place to another. A storage medium can be any available medium that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired computer program code in the form of computer-executable instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, functional computer programs, including, among other things, software, firmware, middleware, microcode, hardware description languages, and
[0162] The ship track generation method and system based on the joint simulation of STK and MATLAB provided by the above embodiments of the present application first selects a suitable model from a preset ship model library, and sets the properties of the model, including size, mass, dynamic parameters, etc., to ensure the accuracy and authenticity of the track simulation. Then, based on MATLAB, the full track points of the ship from the starting point to the ending point are calculated, the error of the track estimation caused by the wind speed and sea current is calculated, and the unpredictability and randomness of the track are increased through the random offset technology. Finally, the dynamic simulation of the track is performed through the animation module of STK, and the generated track data is used for subsequent analysis and application. This method not only improves the efficiency and practicability of track simulation, but also greatly improves the convenience and accuracy of track data analysis through the automatic data processing and output function, and is suitable for fields such as ocean research, navigation safety evaluation, channel planning, and military and education training.
[0163] The matters not fully described in the above embodiments of the present application are all known technologies in the art.
[0164] The specific embodiments of the present application are described above. It should be understood that the present application is not limited to the above specific embodiments, and various modifications or changes can be made by those skilled in the art within the scope of the claims, which does not affect the essential content of the present application.
Claims
1. A ship track generation method based on STK and MATLAB combined simulation, characterized in that, The application relates to a ship track simulation method based on MATLAB and STK, which comprises the following steps: a random seed is set, an STK environment is initialized through MATLAB, and a set simulation scene is loaded; in the simulation scene, a ship model needing simulation is randomly selected, and the type, attribute and speed of each ship model are set; a random algorithm is used to generate the starting point and the ending point of each ship model, an interpolation method is used to generate continuous and various path points, and the track of the ship model is updated in real time through dynamic propagation of the path points; the continuous and various path points are generated through the interpolation method, and the track of the ship model is updated in real time through dynamic propagation of the path points, which comprises the following steps: according to the starting point and the ending point of the randomly generated ship model, a plurality of path points for simulating the sailing track of the ship model are obtained through linear interpolation, and random offsets for being added between the path points are generated, so that continuous and various sailing path points of the ship model are obtained; the sailing path points of each ship model are set, and the path is propagated step by step to dynamically generate the track for the ship model sailing; the continuous and various path points are generated through the interpolation method, and the track of the ship model is updated in real time through dynamic propagation of the path points, which comprises the following steps: according to the starting point and the ending point of the ship model, the path points are obtained through linear interpolation, and the path points are as follows: In the formula, (lat1,lon1) and (lat2,lon2) are the starting and ending points of the ship model, respectively, and n is the number of segments. i ,lon i () represents the position of the i-th coordinate; Random offset Δlat generated and added by interpolation between waypoints i and Δlon i is: Δlat i = (rand - 0.5) x 2δ lat Δlon i = (rand - 0.5) x 2δ lon where rand is a uniformly random number generated in the interval [0, 1), δ lat and δ lon are the maximum latitude and longitude offsets, respectively. The random offset Δlat i and Δlon i are added to the original path point coordinates, resulting in: lat' i = lat i + Δlat i lon i = lon i + Δlon i In the formula, (Lat′ i ,lon′ i ) represents the coordinates of the i-th point in the obtained navigation path.
2. The ship track generation method based on STK and MATLAB combined simulation according to claim 1, characterized in that, the random seed is set, the STK environment is initialized through MATLAB, and the set simulation scene is loaded, which comprises the following steps: a random number generator is set to ensure that the ship track data generated each time can be reproduced; an STK application program is started through an actxserver command in MATLAB, a simulation scene is created in the STK, the time format of the simulation scene is set, and the time range and the analysis starting time are specified to ensure that the time framework of the ship track simulation meets the expectation.
3. The ship track generation method based on STK and MATLAB combined simulation according to claim 1, characterized in that, the ship model needing simulation is randomly selected, and the type, attribute and speed of each ship model are set, which comprises the following steps: the required model is selected from a preset ship model library, the ship model library comprises an aircraft carrier model, a cruise ship model, a destroyer model and a small cargo ship model, and the path of the ship model file and the corresponding type name are stored; according to the number of the ship models needing simulation, each ship model is cyclically created, and the type, speed and attribute of the ship model are set according to the randomly selected ship model file.
4. The ship track generation method based on STK and MATLAB combined simulation according to claim 1, characterized in that, the random algorithm is used to generate the starting point and the ending point of each ship model, which comprises the following steps: a region is defined as a simulation region of the ship model sailing through geographical coordinates; in the simulation region, the starting point coordinates of the ship model are randomly generated through a random algorithm, the ending point coordinates with a certain distance from the starting point coordinates are randomly generated according to a set distance range, so that the starting point and the ending point of the ship model are determined.
5. The ship track generation method based on the joint simulation of STK and MATLAB according to any one of claims 1-4, characterized in that, any one or any multiple of the following is further included: state data is extracted from each ship model, and all the data are output to a CSV file for subsequent analysis and application; the sailing track of the ship is displayed through a visualization module of the STK.
6. The ship track generation method based on STK and MATLAB combined simulation according to claim 5, characterized in that, The state data is extracted from each ship model, and all data is output to a CSV file, including: The state data is extracted from each ship model, including time, longitude, latitude, heading and speed information; The extracted state data is formatted into a standard time format and stored in a data table, obtaining all data; The all data is output to a CSV file.
7. A ship track generation system based on joint simulation of STK and MATLAB, characterized in that, Including: A scenario setting module is configured to set a random seed and initialize an STK environment for loading a set simulation scenario; A model selection module is configured to randomly select a ship model to be simulated in the simulation scenario, and set the corresponding type, attribute and speed for each ship model; A path generation module is configured to generate a starting point and an ending point for each ship model using a random algorithm, generate a plurality of continuous path points using an interpolation method, and update the track of the ship model in real time by dynamically propagating the path points; The plurality of continuous path points are generated using an interpolation method, and the track of the ship model is updated in real time by dynamically propagating the path points, including: According to the randomly generated starting point and ending point of the ship model, a plurality of path points for simulating the ship model's sailing track are obtained by linear interpolation, and a random offset for adding between the path points is generated to obtain a plurality of continuous sailing path points of the ship model; The sailing path points are set for each ship model, and the path is propagated step by step to dynamically generate the track for the ship model sailing; According to the randomly generated starting point and ending point of the ship model, a plurality of path points for simulating the ship model's sailing track are obtained by linear interpolation, and a random offset for adding between the path points is generated to obtain a plurality of continuous sailing path points of the ship model, including: According to the starting point and ending point of the ship model, the path points are obtained by linear interpolation as: where (lati,loni) is the position of the i-th coordinate, n is the number of segments, and (lat1,lon1) and (lat2,lon2) are the start and end points of the ship model, respectively. i ,lon i ) for the i-th coordinate. Random offset Δlat generated and added by interpolation between waypoints i and Δlon i is: Δlat i = (rand - 0.5) x 2δ lat Δlon i = (rand - 0.5) x 2δ lon where rand is a uniformly random number generated in the interval [0, 1), δ lat and δ lon are the maximum latitude and longitude offsets, respectively. The random offset Δlat i and Δlon i are added to the original waypoint coordinates, resulting in: lat′ i = Lat i + Δlat i lon i = lon i + Δlon i In the formula, (lat′ i ,lon′ i ) represents the coordinates of the i-th point in the obtained navigation path.
8. The ship track generation system based on STK and MATLAB combined simulation according to claim 7, characterized in that, Further comprising any one or more of the following modules: A data storage module is configured to extract state data from each ship model and output all data to a CSV file for subsequent analysis and application; A visualization display module is configured to display the sailing track of the ship through the visualization module provided by STK.
Citation Information
Patent Citations
Ship path planning method and device
CN115829179A
Unmanned ship path planning algorithm based on improved DQN
CN117055549A