Visualization method of ship trajectory parallel kernel density based on GPU (Graphics Processing Unit) shader
Through the parallel kernel density visualization method based on GPU shader, the AIS data in maritime traffic is convolutional, which solves the problem of insufficient depth of ship behavior pattern analysis, and achieves efficient data display and strong interactive visualization effects.
Patent Information
- Application Number
- CN202411577355.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The prior art is difficult to efficiently process and visualize ship behavior patterns in maritime traffic, especially in large-scale AIS data, resulting in insufficient analysis depth and low interactiveness and accuracy of data display.
The ship trajectory parallel kernel density visualization method is used based on GPU shader, and the AIS data is processed through the kernel density parallel calculation method of spatiotemporal convolution to generate web visualization results of ship behavior patterns.
It improves the depth of analysis of ship behavior patterns, optimizes the interactivity and accuracy of data display, and improves the capabilities of maritime traffic management and security guarantee.
Smart Images

Figure CN119600133A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of computer technology, and in particular to a visualization method for parallel kernel density of ship tracks based on a GPU shader. Background Art
[0002] With the continuous growth of cross-border trade and the shipping industry, maritime traffic has become increasingly complex and the risks of navigation have increased significantly. In recent years, accidents caused by ship collisions, groundings, waterway congestion and bad weather have occurred frequently. In order to meet these challenges, maritime agencies in various countries have continuously improved their maritime situational awareness (MSA) capabilities and carried out extensive research in the field of maritime intelligent services. Ship behavior pattern mining technology is a key technology for understanding the laws, characteristics and semantic information hidden in a large number of ship activities. It is an important basis for the development of various maritime intelligent service applications such as route prediction and maritime threat warning.
[0003] The Automatic Identification System (AIS) is a ship tracking and monitoring technology based on radio communications. It transmits key data such as the ship's identity information, location, speed and heading to nearby base stations and satellites in real time, providing maritime management personnel with reliable navigation information, and has been widely used in maritime departments of various countries. According to the regulations of the International Maritime Organization, all merchant ships with a gross tonnage of more than 300 tons must be equipped with AIS on international routes to ensure that AIS data has sufficient coverage and data scale. These near-real-time data not only support the identity confirmation and collision avoidance of ships during navigation, but also provide a data basis for managers to mine valuable behavior patterns and laws from ship movement information, thereby improving maritime supervision capabilities.
[0004] However, as the real-time updated AIS data continues to accumulate, the overall knowledge density is relatively low, and extracting valuable behavioral information from massive ship data has become a challenging task. First, ships have a large degree of freedom in navigation and usually do not strictly follow fixed routes, which makes their behavior patterns more diverse and difficult to predict, and has higher complexity than land transportation. Secondly, due to the high frequency of AIS data updates and the extremely large amount of data, higher requirements are placed on algorithm performance in order to achieve efficient processing. Finally, how to intuitively present the analysis results is crucial to improving the practicality of maritime supervision. Summary of the invention
[0005] The main purpose of the embodiment of the present invention is to propose a visualization method of parallel kernel density of ship trajectories based on GPU shaders, which improves the analysis depth of ship behavior patterns and optimizes the interactivity and accuracy of data display.
[0006] To achieve the above object, an embodiment of the present invention provides a method for visualizing the parallel kernel density of ship trajectories based on a GPU shader, comprising the following steps:
[0007] Acquire original AIS data, and preprocess the original AIS data to obtain target data;
[0008] The target data is processed by using a parallel calculation method of kernel density of spatiotemporal convolution to obtain a kernel density processing result of spatiotemporal convolution;
[0009] The kernel density processing result is visualized to obtain a Web visualization result of the ship behavior pattern.
[0010] In some embodiments, the obtaining of raw AIS data and preprocessing of the raw AIS data to obtain target data comprises the following steps:
[0011] According to the original AIS data, the location point data is sorted by time, and the ships with the same unique identifier are strung into track lines in chronological order, the latitude and longitude, speed and reporting time of the location points are retained, and the ship track is generated;
[0012] An error threshold is set, and the Douglas Planck algorithm is used on the obtained ship trajectory to compress the trajectory points whose motion directions do not change much, so as to obtain a polyline set composed of trajectory points that retain motion characteristics, thereby completing the compression processing of the ship trajectory;
[0013] According to a preset distance threshold and an average speed of the path, the abnormal track in the ship track is deleted to complete the cleaning process of the ship track;
[0014] Modeling the motion process of the trajectory using the trajectory line segments in the ship trajectory as units to analytically describe the motion process of the ship;
[0015] Among them, in the process of modeling the motion process of the trajectory, the calculation formula of each motion parameter is:
[0016] p(t)=p(t0)+x
[0017]
[0018] Where p(t) represents the position at time t; p(t0) represents the position at time t0; x represents the displacement relative to time t0; v init represents the initial velocity of the model fitting; a represents the acceleration of the model fitting; v1 represents the instantaneous velocity of the end point of the line segment; v0 represents the instantaneous velocity of the beginning of the line segment; dis() represents the distance function; p1 represents the coordinates of the end point of the line segment; p0 represents the coordinates of the starting point of the line segment.
[0019] In some embodiments, the kernel density parallel calculation method using spatiotemporal convolution is used to process the target data to obtain the kernel density processing result of the spatiotemporal convolution, including the following steps:
[0020] According to the target data, the motion information of each trajectory point is represented by a four-dimensional vector, and the eight-bit vector composed of line segments is used as the input of each vertex shader of WebGL, and loaded into the vertex buffer to complete the loading of vertex information;
[0021] According to the loaded vertex information, a directional rectangular boundary is calculated according to the line segment input each time the vertex is used as the potential range of action of the kernel density in the two-dimensional space when the radius parameter is r, thereby completing the generation of geometric primitives;
[0022] Considering the time information and the space information, performing kernel density calculation according to the geometric primitives;
[0023] According to the result of the kernel density calculation, the calculated kernel density value is stored in the color channel of each pixel, and after generating the directional rectangular primitive, each rectangle is rasterized through the rendering pipeline, and the kernel density calculation method of the spatiotemporal convolution is implemented in the fragment shader, so that each pixel value of the rectangular primitive retains the calculated kernel density information, and a density map is generated;
[0024] Among them, the final density value of the current pixel is the sum of the density contributions of all N trajectories to the current pixel, and the calculation formula is:
[0025]
[0026] Among them, C(q) represents the final density value at the location of point q.
[0027] In some embodiments, the step of calculating a directional rectangular boundary according to the loaded vertex information and the line segment inputted at each vertex as the potential range of action of the kernel density in the two-dimensional space when the radius parameter is r, and completing the generation of geometric primitives includes the following steps:
[0028] Calculate the direction unit vector direction and the normal unit vector n of the trajectory segment;
[0029] Given the radius parameter r, calculate the offset of the four vertices of the rectangle relative to the input line segment endpoint in the line segment direction and normal direction, and obtain the vertices of the rectangular primitive (N1, M2, N3, N4). The calculation formula is:
[0030]
[0031] n=(-direction.y,direction.x)
[0032]
[0033] Among them, p1 represents the end point of the line segment; p0 represents the starting point of the line segment; x represents the horizontal coordinate of the normal unit vector; y represents the vertical coordinate of the normal unit vector.
[0034] In some embodiments, the considering of time information and space information and performing kernel density calculation according to the geometric primitives comprises the following steps:
[0035] Considering that the distance between the target point and the line segment and the time the ship stays on the line segment affect the density value of the target point q, according to the given kernel density parameter r, the search is performed with the target point q as the center and r as the radius, and the intersection points r1 and r2 of the boundary of the search range and the trajectory line segment ((p1, p0)) are calculated. The line segment (r1, r2) is the trajectory object that actually contributes to the q density;
[0036] Considering the influence of spatial position on the density of target point q, the Gaussian kernel function is used for calculation. The calculation formula is: Among them, K(x,r) represents the Gaussian kernel function, x represents the distance from the target point q to the line segment, and r represents the bandwidth of the kernel function;
[0037] Considering the influence of time on the density of the point q, the time t(x) at each position on r1 and r2 is inferred based on the motion model and the obtained spatial position information, and the trajectory segment is calculated at [t r1 ,t r2 ]The density contribution to q in time C traj1 , the calculation formula is:
[0038]
[0039]
[0040] Among them, v init represents the initial velocity after model fitting; a represents the acceleration after model fitting.
[0041] In some embodiments, the visualizing the kernel density processing result to obtain a Web visualization result of the ship behavior pattern comprises the following steps:
[0042] The real density value is obtained according to the color channel information of the kernel density map, and the density value is graded and colored; specifically, the kernel density value is mapped logarithmically, and the converted density value Density(q) is used to project the density characteristics of different regions using linear gradient to complete the color texture generation;
[0043] Use lighting textures to characterize data features and differences between density values. Specifically, map density values to height features of a two-dimensional plane and generate a normal map from the density field. Based on the normal map, use the Phong shadow model to calculate the final lighting texture given the ambient light and light source position.
[0044] The calculation of all the different textures is managed through the frame buffer, and finally the color texture and the lighting texture are merged in the rendering pipeline to get the final result, which determines the web visualization result of the ship's behavior pattern.
[0045] In some embodiments, the calculation formula of the density feature is:
[0046] Density(q)=log2(C(q)+1)
[0047] The calculation formula of the normal map is:
[0048] norml(i,j)=normalize((C(i-1,j)-C(i+1,j)) / 2,(C(i,j-1)-C(i,j+1)) / 2,1.0)
[0049] The calculation formula of the illumination texture is:
[0050] Light(i,j)=normal(i,j)·DiffuseLightDirection·ObjectColot+Ambient·ObjectColor
[0051] Among them, Density(q) represents the density value; C(q) represents the final density value at the position of point q; norml(i,j) represents the normalized normal vector at the position (i,j); normalize() represents the vector normalization function; Light(i,j) represents the texture at the position (i,j) of the object after illumination; DiffuseLightDirection represents the diffuse light source; ObjectColor represents the original texture of the object; Ambient represents ambient light.
[0052] Another aspect of the embodiment of the present invention further provides a visualization system of ship trajectory parallel kernel density based on GPU shader, including:
[0053] The first module is used to obtain original AIS data and pre-process the original AIS data to obtain target data;
[0054] The second module is used to process the target data using a parallel calculation method of kernel density of spatiotemporal convolution to obtain a kernel density processing result of spatiotemporal convolution;
[0055] The third module is used to visualize the kernel density processing results to obtain Web visualization results of the ship behavior pattern.
[0056] Another aspect of an embodiment of the present invention provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above-mentioned method when executing the computer program.
[0057] To achieve the above objective, another aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method is implemented.
[0058] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.
[0059] The embodiments of the present invention include at least the following beneficial effects: the present invention provides a method and system for visualizing the parallel kernel density of ship trajectories based on GPU shaders, the scheme obtains the original AIS data and pre-processes the original AIS data to obtain the target data; uses the kernel density parallel calculation method of spatiotemporal convolution to process the target data to obtain the kernel density processing result of spatiotemporal convolution; visualizes the kernel density processing result to obtain the Web visualization result of the ship behavior pattern. The embodiments of the present invention improve the analysis depth of the ship behavior pattern and optimize the interactivity and accuracy of the data display. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present invention;
[0061] Figure 2 is a flow chart of the overall steps provided by an embodiment of the present invention;
[0062] Figure 3 It is a flowchart of specific implementation steps provided by an embodiment of the present invention;
[0063] Figure 4 is a parallel calculation process diagram of spatiotemporal convolution kernel density provided by an embodiment of the present invention;
[0064] Figure 5 Schematic diagram of spatiotemporal convolution kernel density calculation provided by an embodiment of the present invention;
[0065] Figure 6 is a visualization effect diagram of an example ship trajectory moving at a reduced speed from the lower left to the upper right provided by an embodiment of the present invention;
[0066] Figure 7 It is a visualization effect diagram of real data provided by an embodiment of the present invention;
[0067] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present invention. They are only examples of devices and methods consistent with some aspects of the embodiments of the present invention as detailed in the attached claims.
[0069] It is understood that the terms "first", "second", etc. used in the present invention may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0070] The terms "at least one", "multiple", "each", "any", etc. used in the present invention, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0072] Before describing the embodiments of the present invention in detail, some related technologies involved in the embodiments of the present invention are first described as follows:
[0073] Automatic Identification System (AIS): Automatic Identification System (AIS) is an automated tracking system widely used in ship communications and navigation. AIS regularly sends important information including ship identification number, position, speed and heading through transmitters installed on ships. These data not only help ships to identify each other and avoid collisions, but also provide important data support for maritime traffic management, search and rescue operations and navigation research.
[0074] Web visualization technology: Visualization is the process of converting abstract data into graphics or images for intuitive understanding and analysis. Web visualization refers to the graphical representation of data presented and interacted in the browser through web page technology. It converts complex data sets into easy-to-understand charts, maps, images or other visualization forms, allowing users to access and analyze data in real time through a network platform. This method combines the advantages of modern web technology and data visualization technology, and can display and analyze data on any device that supports a web browser.
[0075] Kernel density estimation: Kernel density estimation (KDE) is a non-parametric statistical method for inferring unknown probability density functions. Compared with traditional histograms, kernel density estimation can provide a smooth density curve without relying on fixed interval divisions, thereby more accurately describing the distribution of data. In kernel density estimation, each data point is centered on a smooth function called a "kernel function" and the local density is estimated according to its distance weight. Commonly used kernel functions include Gaussian kernels. These kernel functions are usually symmetric and have a smooth bell-shaped curve. By superimposing these kernel functions, a smooth density curve for the entire data set is formed. Through kernel density estimation, potential distribution patterns in the data set can be identified, such as navigation hotspots or behavioral concentration areas of ships.
[0076] WebGL rendering technology: WebGL (Web Graphics Library) is a JavaScript-based graphics rendering technology that allows efficient 2D and 3D graphics rendering directly using the GPU in the browser without the need for additional plug-ins. Through real-time rendering, cross-platform compatibility, and shader programming, WebGL can achieve complex graphics effects in a web page environment, and is suitable for applications that require high-performance graphics processing, such as data visualization, 3D modeling, and virtual reality.
[0077] The visualization method and system of the parallel kernel density of ship trajectories based on GPU shaders provided in an embodiment of the present invention relate to the field of computer technology. The visualization method of the parallel kernel density of ship trajectories based on GPU shaders provided in an embodiment of the present invention can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the visualization method of the parallel kernel density of ship trajectories based on GPU shaders, etc., but is not limited to the above forms.
[0078] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0079] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.
[0080] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0081] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
[0082] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal 102 may also be a vehicle-mounted terminal of various device types described above, but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment of the present invention.
[0083] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a method for visualizing the parallel kernel density of ship trajectories based on a GPU shader. The following is explained using the example of applying the method for visualizing the parallel kernel density of ship trajectories based on a GPU shader in a server 101. It can be understood that the method can also be applied to a terminal 102.
[0084] Reference Figure 2 , Figure 2 A flowchart of a method for visualizing the parallel kernel density of ship trajectories based on a GPU shader and applied to a server according to an embodiment of the present invention. The execution subject of the method can be any of the aforementioned computer devices (including a server or a terminal). Figure 2 , the method may include the following steps:
[0085] Acquire original AIS data, and preprocess the original AIS data to obtain target data;
[0086] The target data is processed by using a parallel calculation method of kernel density of spatiotemporal convolution to obtain a kernel density processing result of spatiotemporal convolution;
[0087] The kernel density processing result is visualized to obtain a Web visualization result of the ship behavior pattern.
[0088] In some embodiments, the obtaining of raw AIS data and preprocessing of the raw AIS data to obtain target data comprises the following steps:
[0089] According to the original AIS data, the location point data is sorted by time, and the ships with the same unique identifier are strung into track lines in chronological order, the latitude and longitude, speed and reporting time of the location points are retained, and the ship track is generated;
[0090] An error threshold is set, and the Douglas Planck algorithm is used on the obtained ship trajectory to compress the trajectory points whose motion directions do not change much, so as to obtain a polyline set composed of trajectory points that retain motion characteristics, thereby completing the compression processing of the ship trajectory;
[0091] According to a preset distance threshold and an average speed of the path, the abnormal track in the ship track is deleted to complete the cleaning process of the ship track;
[0092] Modeling the motion process of the trajectory using the trajectory line segments in the ship trajectory as units to analytically describe the motion process of the ship;
[0093] Among them, in the process of modeling the motion process of the trajectory, the calculation formula of each motion parameter is:
[0094] p(t)=p(t0)+x
[0095]
[0096] Where p(t) represents the position at time t; p(t0) represents the position at time t0; x represents the displacement relative to time t0; v init represents the initial velocity of the model fitting; a represents the acceleration of the model fitting; v1 represents the instantaneous velocity of the end point of the line segment; v0 represents the instantaneous velocity of the beginning of the line segment; dis() represents the distance function; p1 represents the coordinates of the end point of the line segment; p0 represents the coordinates of the starting point of the line segment.
[0097] In some embodiments, the kernel density parallel calculation method using spatiotemporal convolution is used to process the target data to obtain the kernel density processing result of the spatiotemporal convolution, including the following steps:
[0098] According to the target data, the motion information of each trajectory point is represented by a four-dimensional vector, and the eight-bit vector composed of line segments is used as the input of each vertex shader of WebGL, and loaded into the vertex buffer to complete the loading of vertex information;
[0099] According to the loaded vertex information, a directional rectangular boundary is calculated according to the line segment input each time the vertex is used as the potential range of action of the kernel density in the two-dimensional space when the radius parameter is r, thereby completing the generation of geometric primitives;
[0100] Considering the time information and the space information, performing kernel density calculation according to the geometric primitives;
[0101] According to the result of the kernel density calculation, the calculated kernel density value is stored in the color channel of each pixel, and after generating the directional rectangular primitive, each rectangle is rasterized through the rendering pipeline, and the kernel density calculation method of the spatiotemporal convolution is implemented in the fragment shader, so that each pixel value of the rectangular primitive retains the calculated kernel density information, and a density map is generated;
[0102] Among them, the final density value of the current pixel is the sum of the density contributions of all N trajectories to the current pixel, and the calculation formula is:
[0103]
[0104] Among them, C(q) represents the final density value at the location of point q.
[0105] In some embodiments, the step of calculating a directional rectangular boundary according to the loaded vertex information and the line segment inputted at each vertex as the potential range of action of the kernel density in the two-dimensional space when the radius parameter is r, and completing the generation of geometric primitives includes the following steps:
[0106] Calculate the direction unit vector direction and the normal unit vector n of the trajectory segment;
[0107] Given the radius parameter r, calculate the offset of the four vertices of the rectangle relative to the input line segment endpoint in the line segment direction and normal direction, and obtain the vertices (N1, N2, N3, N4) of the rectangular primitive. The calculation formula is:
[0108]
[0109] n=(-direction.v,direction.x)
[0110]
[0111] Among them, p1 represents the end point of the line segment; p0 represents the starting point of the line segment; x represents the horizontal coordinate of the normal unit vector; y represents the vertical coordinate of the normal unit vector.
[0112] In some embodiments, the considering of time information and space information and performing kernel density calculation according to the geometric primitives comprises the following steps:
[0113] Considering that the distance between the target point and the line segment and the time the ship stays on the line segment affect the density value of the target point q, according to the given kernel density parameter r, the search is performed with the target point q as the center and r as the radius, and the intersection points r1 and r2 of the boundary of the search range and the trajectory line segment ((p1, p0)) are calculated. The line segment (r1, r2) is the trajectory object that actually contributes to the q density;
[0114] Considering the influence of spatial position on the density of target point q, the Gaussian kernel function is used for calculation. The calculation formula is: Among them, K(x,r) represents the Gaussian kernel function, x represents the distance from the target point q to the line segment, and r represents the bandwidth of the kernel function;
[0115] Considering the influence of time on the density of the point q, the time t(x) at each position on r1 and r2 is inferred based on the motion model and the obtained spatial position information, and the trajectory segment is calculated at [t r1 ,t r2 ]The density contribution to q in time C traj1 , the calculation formula is:
[0116]
[0117] Among them, v init represents the initial velocity after model fitting; a represents the acceleration after model fitting.
[0118] In some embodiments, the visualizing the kernel density processing result to obtain a Web visualization result of the ship behavior pattern comprises the following steps:
[0119] The real density value is obtained according to the color channel information of the kernel density map, and the density value is graded and colored; specifically, the kernel density value is mapped logarithmically, and the converted density value Density(q) is used to project the density characteristics of different regions using linear gradient to complete the color texture generation;
[0120] Use lighting textures to characterize data features and differences between density values. Specifically, map density values to height features of a two-dimensional plane and generate a normal map from the density field. Based on the normal map, use the Phong shadow model to calculate the final lighting texture given the ambient light and light source position.
[0121] The calculation of all the different textures is managed through the frame buffer, and finally the color texture and the lighting texture are merged in the rendering pipeline to get the final result, which determines the web visualization result of the ship's behavior pattern.
[0122] In some embodiments, the calculation formula of the density feature is:
[0123] Density(q)=log2(C(q)+1)
[0124] The calculation formula of the normal map is:
[0125] norml(i,j)=normalize((C(i-1,j)-C(i+1,j)) / 2,(C(i,j-1)-C(i,j+1)) / 2,1.0)
[0126] The calculation formula of the illumination texture is:
[0127] Light(i,j)=normal(i,j)·DiffuseLightDirection·ObjectColor+Ambient·ObjectColor
[0128] Among them, Density(q) represents the density value; C(q) represents the final density value at the position of point q; norml(i,j) represents the normalized normal vector at the position (i,j); normalize() represents the vector normalization function; Light(i,j) represents the texture at the position (i,j) of the object after illumination; DiffuseLightDirection represents the diffuse light source; ObjectColor represents the original texture of the object; Ambient represents ambient light.
[0129] The following specific application scenario is taken as an example to describe the specific implementation process of the embodiment of the present invention in detail:
[0130] In view of the problems existing in the prior art, the embodiment of the present invention proposes a method for visualizing ship behavior patterns based on AIS data, which combines data mining and visualization technology to provide a powerful and intuitive analysis framework for maritime management. This method not only improves the analysis depth of ship behavior patterns, but also optimizes the interactivity and accuracy of data display, thereby effectively improving the maritime traffic management and safety assurance capabilities in complex marine environments.
[0131] In the field of ship dynamic behavior analysis and mining, the following problems exist:
[0132] 1. Most existing technologies and visualization systems are superficial in their exploration of ship behavior patterns, usually limited to displaying updated information and basic attributes of ships, or feature analysis of a certain dimension (such as geographical distribution). Although the academic community has proposed a variety of complex algorithms in combination with advanced technologies, these methods are still insufficient in terms of expression ability and practical application. At present, there is no unified workflow that can comprehensively analyze the correlation between multi-dimensional attributes of ships, correctly express data features and maintain good visual effects.
[0133] 2. In practical applications, existing systems often pay less attention to ease of use, real-time and scalability, and have difficulty processing large-scale data sets, and are mainly limited to processing specific small-scale data sets.
[0134] The purpose of the present invention is to provide a technology that is suitable for effective mining of large-scale ship behaviors and can obtain the behavioral characteristics and distribution patterns of ships. The technology has the following characteristics:
[0135] 1. Considering the potential performance challenges, the technology integrates GPU acceleration technology into algorithms and visualization methods to cope with larger-scale data and more complex offshore environments, ensuring the smoothness of user interaction and exploration.
[0136] 2. This technology not only considers spatial position, but also introduces deep mining of key motion features such as speed, and effectively integrates these spatiotemporal features into the visualization system. Such a design not only enhances the depth of mining, but also improves the intuitiveness of the system, making it more suitable for maritime traffic analysis and data mining tasks.
[0137] refer to Figure 3 In an embodiment of the present invention, the method for visualizing ship behavior patterns based on AIS data specifically includes the following steps:
[0138] Step 1: AIS data preprocessing. This stage mainly performs trajectory generation, compression, cleaning, and motion modeling on the original AIS data to lay the foundation for subsequent visualization. The specific steps are as follows:
[0139] Step 1: Track generation: Sort the location point data by time, and string the ships with the same unique identifier into track lines in chronological order, retaining the longitude and latitude, speed and reporting time of the location points, such as any track point p0 = (lng0, lat0, v0, t0).
[0140] Step 2: Trajectory compression: Set the error threshold δ and use the Douglas Planck algorithm (DP) on the obtained trajectory data to compress the trajectory points with little change in motion direction, and obtain a broken line set composed of trajectory points that retain motion characteristics.
[0141] Step 3: Track cleaning: According to the set distance threshold dmax and the average speed vmax of the path, the abnormal tracks with drift and abnormal speed will be deleted to deal with the errors caused by GPS positioning accuracy and message transmission. For any two adjacent track points p0 and p1 on the polyline, the following rules apply:
[0142]
[0143] Step 4: Motion modeling: Model the motion process of the trajectory using trajectory segments as units, so as to analytically describe the motion process of the ship. The uniform acceleration motion model is mainly used here. The calculation formula for the position p(t) at any time is as follows, where v init ,a is the motion parameter calculated based on the original data.
[0144] p(t)=p(t0)+x
[0145]
[0146] Step 2: Parallel calculation method of kernel density of spatiotemporal convolution. In this stage, a kernel density method of spatiotemporal convolution for ship motion characteristics is proposed, and the implementation method of the algorithm in GPU is given. The algorithm involved is mainly written in shader language. The specific detailed steps are as follows: Figure 4 shown.
[0147] Step 1: Vertex information loading: The motion information of each trajectory point is represented by a four-dimensional vector (same as step 1), and the eight-bit vector (lng0, lat0, v0, t0, lng1, lat1, v1, t1) composed of line segments is loaded into the vertex buffer as the input of each vertex shader of WebGL.
[0148] Step 2: Geometric primitive generation: Calculate a directional rectangular boundary based on the line segment input each time the vertex is used as the potential range of action of the kernel density in two-dimensional space when the radius parameter is r. The calculation process of this step is still performed in the fixed-point shader. Specifically, first calculate the direction unit vector direction of the trajectory segment and the normal unit vector n. Calculate the offset of the four vertices of the rectangle relative to the input line segment endpoint in the line segment direction and normal direction based on the given radius parameter r, and finally get the vertices of the rectangular primitive (N1, N2, N3, N4). The specific calculation formula is as follows:
[0149]
[0150] n=(-direction.y,direction.x)
[0151]
[0152] Step 3: Kernel density calculation: We propose a kernel density calculation method that takes into account time and space information, which can reflect the motion characteristics of the ship in the density map. Specifically, for any point q in the rectangular element (N1, N2, N4, N3) generated by the trajectory segment ((p1, p0), the calculation method of the trajectory segment ((p1, p0)) to its density is as follows: Figure 5 shown.
[0153] (1) According to the given kernel density parameter r, a search is performed with q as the center and r as the radius. The intersection points r1 and r2 of the boundary of the search range and the trajectory segment ((p1, p0)) are calculated. The segment (r1, r2) is the trajectory object that actually contributes to the q density. The main starting point of our method is that the distance between the target point and the segment and the time the ship stays on the segment affect the q density value of the target point.
[0154] (2) Considering the influence of spatial position on the density of the point q, the kernel function is used for calculation. The Gaussian kernel function is mainly used in the method, and its formula is as follows:
[0155]
[0156] (3) Considering the influence of time on the density of the point q, through the motion model mentioned in step 1, the time t(x) at each position on r1 and r2 can be inferred based on the obtained spatial position information, so that the trajectory segment (traj1) can be calculated at [t r1 ,t r2 ]The density contribution to q in time C traj1 , the relevant calculation formula is as follows:
[0157]
[0158] Step 4: Generation of density map: The calculated kernel density value is stored in the color channel (RGBA) of each pixel. After generating the directional rectangular primitive, the rendering pipeline will rasterize each rectangle, and this process is also parallel. The kernel density calculation method of spatiotemporal convolution is implemented in the fragment shader, so that each pixel value of the rectangular primitive can retain the calculated kernel density information and ensure the efficiency of the calculation process. In this stage, the final density value of the current pixel is the sum of the density contributions of all N trajectories to the current pixel. The calculation formula is as follows:
[0159]
[0160] Step 3: Kernel density visualization method for spatiotemporal convolution. In this stage, a visualization method for the calculated kernel density map is proposed. The process involved is also performed on the GPU. The specific steps are as follows: Figure 6 shown.
[0161] Step 1: Color texture generation: Get the real density value according to the color channel information of the kernel density map, and color the density value in different levels. We use logarithmic mapping to map the kernel density value, so that it can support a larger data range. Use linear gradient to display the density characteristics of different regions.
[0162] Density(q)=log2(C(q)+1)
[0163] Step 2: Lighting texture generation: Use the lighting texture to further characterize the data features and the differences between density values. First, map the density value to the height feature of the two-dimensional plane, and generate the normal field from the density field. The calculation method of the normal map is as follows:
[0164] norml(i,j)=normalize((C(i-1,j)-C(i+1,j)) / 2,(C(i,j-1)-C(i,j+1)) / 2,1.0) Based on the normal map, the Phong shadow model is used to calculate the final lighting texture given the ambient light and light source position. In the experiment, the diffuse light source (Diffuse) and ambient light source (Ambient) are mainly considered, including the incident angle DiffuseLightDirection of the parallel light source and the color of the material (ObjectColor). The specific calculation formula is as follows:
[0165] Light(i,j)=normal(i,j)·DiffuseLightDirection·ObjectColor+Ambient·ObjectColor
[0166] Step 3: Final visualization generation: All calculations of different textures are managed through the frame buffer, and finally the color texture and the light texture are merged in the rendering pipeline to get the final result. The test results on the real ship trajectory dataset are shown in Figure 2. Figure 7 shown.
[0167] In summary, the present invention realizes a ship behavior pattern analysis technology, which models ship behavior through a probability distribution model and uses visualization technology to enhance the performance of the results, thereby improving the efficiency of maritime supervision.
[0168] The present invention has the following characteristics:
[0169] 1. Calculation method of spatiotemporal convolution density: This method improves the traditional kernel density statistical method by considering the spatiotemporal factors of ship behavior. It not only considers the distribution of ships in space, but also includes the calculation of the impact of the temporal persistence of moving objects on the area, allowing the dynamic characteristics of ships in the area (such as low or high speed) to be reflected in detail in the results. This method makes the analysis of ship behavior at sea more refined and accurate.
[0170] 2. Parallel computing implementation of the algorithm: A parallel computing method based on WebGL is proposed, which significantly improves the visualization performance of the algorithm calculation and results, and is particularly suitable for interactive visualization scenarios. Through parallel processing, this technology can effectively support more complex analysis tasks, realize real-time data processing and display, and greatly improve the system's response speed and user experience.
[0171] Compared with the prior art, the present invention has the following advantages:
[0172] 1. Identify the dynamic characteristics of ships: Compared with the traditional point kernel density method, this technology uses the line kernel density method as the analysis basis, which effectively retains the continuity of the ship's motion process. In addition, this technology also introduces the convolution processing of kernel density in time, which not only considers the spatial distance, but also incorporates the residence time of the ship in a specific area into the important factor of kernel density calculation, so as to more accurately identify and distinguish various dynamic behaviors, such as the distinction between different speed areas (low-speed area and high-speed area).
[0173] 2. Rich information expression: This paper proposes a visualization method for spatiotemporal convolution kernel density, which uses the graded coloring and lighting effects in graphics technology to significantly enhance the expression of data differences and improve the efficiency and accuracy of visual analysis.
[0174] 3. Higher computing performance: By implementing the spatiotemporal convolution kernel density method in WebGL, this technology can use GPU to accelerate computing and rendering, greatly improving performance. This enables this technology to support real-time, interactive data exploration and analysis. Compared with traditional offline analysis methods, users can more flexibly adjust the perspective, perform data screening and detailed exploration.
[0175] 4. Support Web integration: This technology, implemented based on WebGL, makes full use of the convenience of the Web and is easy to integrate into network applications. At the same time, it overcomes the shortcomings of traditional technologies in computing efficiency and provides users with a seamless and efficient maritime navigation behavior analysis platform.
[0176] Another aspect of the embodiment of the present invention further provides a visualization system of ship trajectory parallel kernel density based on GPU shader, including:
[0177] The first module is used to obtain original AIS data and pre-process the original AIS data to obtain target data;
[0178] The second module is used to process the target data using a parallel calculation method of kernel density of spatiotemporal convolution to obtain a kernel density processing result of spatiotemporal convolution;
[0179] The third module is used to visualize the kernel density processing results to obtain Web visualization results of the ship behavior pattern.
[0180] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0181] The embodiment of the present invention further provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned visualization method of parallel kernel density of ship trajectories based on GPU shader when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0182] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0183] See also Figure 8 , Figure 8 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0184] The processor 801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention;
[0185] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the visualization method of the parallel kernel density of ship trajectories based on GPU shaders in the embodiment of the present invention;
[0186] Input / output interface 803, used to implement information input and output;
[0187] The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0188] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);
[0189] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0190] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned method for visualizing the parallel kernel density of ship trajectories based on a GPU shader.
[0191] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0192] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0193] It should be noted that in various specific embodiments of the present invention, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present invention needs to obtain the user's sensitive personal information, it will obtain the user's separate permission or consent through a pop-up window or jump to a confirmation page, and after clearly obtaining the user's separate permission or consent, it will obtain the necessary user-related data for the normal operation of the embodiment of the present invention.
[0194] The embodiments described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those skilled in the art can appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.
[0195] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present invention and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0196] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0197] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0198] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0199] It should be understood that in the present invention, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can represent: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0200] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0201] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0202] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0203] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including multiple instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store programs.
[0204] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the embodiments of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present invention shall be within the scope of the rights of the embodiments of the present invention.
Claims
1. A method for visualizing the parallel kernel density of ship trajectories based on GPU shaders, characterized in that: The following steps are involved: Acquire original AIS data, and preprocess the original AIS data to obtain target data; The target data is processed by using a parallel calculation method of kernel density of spatiotemporal convolution to obtain a kernel density processing result of spatiotemporal convolution; The kernel density processing result is visualized to obtain a Web visualization result of the ship behavior pattern.
2. The method for visualizing the parallel kernel density of ship trajectories based on GPU shader according to claim 1, characterized in that: The obtaining of original AIS data and preprocessing of the original AIS data to obtain target data comprises the following steps: According to the original AIS data, the location point data is sorted by time, and the ships with the same unique identifier are strung into track lines in chronological order, the latitude and longitude, speed and reporting time of the location points are retained, and the ship track is generated; An error threshold is set, and the Douglas Planck algorithm is used on the obtained ship trajectory to compress the trajectory points whose motion directions do not change much, so as to obtain a polyline set composed of trajectory points that retain motion characteristics, thereby completing the compression processing of the ship trajectory; According to a preset distance threshold and an average speed of the path, the abnormal track in the ship track is deleted to complete the cleaning process of the ship track; Modeling the motion process of the trajectory using the trajectory line segments in the ship trajectory as units to analytically describe the motion process of the ship; Among them, in the process of modeling the motion process of the trajectory, the calculation formula of each motion parameter is: p(t)=p(t0)+x Where p(t) represents the position at time t; p(t0) represents the position at time t0; x represents the displacement relative to time t0; v init represents the initial velocity of the model fitting; a represents the acceleration of the model fitting; v1 represents the instantaneous velocity of the end point of the line segment; v0 represents the instantaneous velocity of the beginning of the line segment; dis() represents the distance function; p1 represents the coordinates of the end point of the line segment; p0 represents the coordinates of the starting point of the line segment.
3. The method for visualizing the parallel kernel density of ship trajectories based on GPU shader according to claim 1, characterized in that: The kernel density parallel calculation method using spatiotemporal convolution is used to process the target data to obtain the kernel density processing result of spatiotemporal convolution, including the following steps: According to the target data, the motion information of each trajectory point is represented by a four-dimensional vector, and the eight-bit vector composed of line segments is used as the input of each vertex shader of WebGL, and loaded into the vertex buffer to complete the loading of vertex information; According to the loaded vertex information, a directional rectangular boundary is calculated according to the line segment input each time the vertex is used as the potential range of action of the kernel density in the two-dimensional space when the radius parameter is r, thereby completing the generation of geometric primitives; Considering the time information and the space information, performing kernel density calculation according to the geometric primitives; According to the result of the kernel density calculation, the calculated kernel density value is stored in the color channel of each pixel, and after generating the directional rectangular primitive, each rectangle is rasterized through the rendering pipeline, and the kernel density calculation method of the spatiotemporal convolution is implemented in the fragment shader, so that each pixel value of the rectangular primitive retains the calculated kernel density information, and a density map is generated; Among them, the final density value of the current pixel is the sum of the density contributions of all N trajectories to the current pixel, and the calculation formula is: Among them, C(q) represents the final density value at the location of point q.
4. The method for visualizing the parallel kernel density of ship trajectories based on GPU shader according to claim 3, characterized in that: The method of calculating a directional rectangular boundary according to the loaded vertex information and the line segment inputted at each vertex as the potential range of action of the kernel density in the two-dimensional space when the radius parameter is r, and completing the generation of geometric primitives includes the following steps: Calculate the direction unit vector direction and the normal unit vector n of the trajectory segment; Given the radius parameter r, calculate the offset of the four vertices of the rectangle relative to the input line segment endpoint in the line segment direction and normal direction, and obtain the vertices (N1, N2, N3, N4) of the rectangular primitive. The calculation formula is: n=(-direction.y,direction.x) Among them, p1 represents the end point of the line segment; p0 represents the starting point of the line segment; x represents the horizontal coordinate of the normal unit vector; y represents the vertical coordinate of the normal unit vector.
5. The method for visualizing the parallel kernel density of ship trajectories based on GPU shader according to claim 3, characterized in that: The method of considering time information and space information and performing kernel density calculation according to the geometric primitives comprises the following steps: Considering that the distance between the target point and the line segment and the time the ship stays on the line segment affect the density value of the target point q, according to the given kernel density parameter r, the search is performed with the target point q as the center and r as the radius, and the intersection points r1 and r2 of the boundary of the search range and the trajectory line segment ((p1, p0)) are calculated. The line segment (r1, r2) is the trajectory object that actually contributes to the q density; Considering the influence of spatial position on the density of target point q, the Gaussian kernel function is used for calculation. The calculation formula is: Among them, K(x,r) represents the Gaussian kernel function, x represents the distance from the target point q to the line segment, and r represents the bandwidth of the kernel function; Considering the influence of time on the density of the point q, the time t(x) at each position on r1 and r2 is inferred based on the motion model and the obtained spatial position information, and the trajectory segment is calculated at [t r1 ,t r2 ]The density contribution to q in time C traj1 , the calculation formula is: Among them, v init represents the initial velocity after model fitting; a represents the acceleration after model fitting.
6. The method for visualizing the parallel kernel density of ship trajectories based on GPU shader according to claim 1, characterized in that: The process of visualizing the kernel density processing result to obtain a Web visualization result of the ship behavior pattern comprises the following steps: The real density value is obtained according to the color channel information of the kernel density map, and the density value is graded and colored; specifically, the kernel density value is mapped logarithmically, and the converted density value Density(q) is used to project the density characteristics of different regions using linear gradient to complete the color texture generation; Use lighting textures to characterize data features and differences between density values. Specifically, map density values to height features of a two-dimensional plane and generate a normal map from the density field. Based on the normal map, use the Phong shadow model to calculate the final lighting texture given the ambient light and light source position. The calculation of all the different textures is managed through the frame buffer, and finally the color texture and the lighting texture are merged in the rendering pipeline to get the final result, which determines the web visualization result of the ship's behavior pattern.
7. The method for visualizing the parallel kernel density of ship trajectories based on GPU shader according to claim 6, characterized in that: The calculation formula of the density feature is: Density(q)=log2(C(q)+1) The calculation formula of the normal map is: norml(i,j)=normalize((C(i-1,j)-C(i+1,j)) / 2,(C(i,j-1)-C(i,j+1)) / 2,1.0) The calculation formula of the illumination texture is: Light(i,j)=normal(i,j)·DiffuseLightDirection·ObjectColor+Ambient·ObjectColor Among them, Density(q) represents the density value; C(q) represents the final density value at the position of point q; norml(i,j) represents the normalized normal vector at the position (i,j); normalize() represents the vector normalization function; Light(i,j) represents the texture at the position (i,j) of the object after illumination; DiffuseLightDirection represents the diffuse light source; objectColor represents the original texture of the object; Ambient represents ambient light.
8. A GPU shader-based ship trajectory parallel kernel density visualization system, characterized in that: include: The first module is used to obtain original AIS data and pre-process the original AIS data to obtain target data; The second module is used to process the target data using a parallel calculation method of kernel density of spatiotemporal convolution to obtain a kernel density processing result of spatiotemporal convolution; The third module is used to visualize the kernel density processing results to obtain Web visualization results of the ship behavior pattern.
9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Industrial manufacturing process and production operation and maintenance optimization method and system based on digital twinning
CN118884908A
Inversion-based workflow for consistent interpretation of nuclear density images in horizontal wells
US20160252648A1
Image processing using iterative generation of intermediate images using photon beams of varying parameters
US8638331B1
Cited By
Space-time kernel density visualization method and system based on module compression, terminal and readable storage medium
CN120217168A
Space-time Kernel Density Visualization Method, System, Terminal and Readable Storage Medium Based on Module Compression
CN120217168B