Navigation situation voice automatic early warning method and device based on Raspberry Pi

By parsing AIS information and generating voice warnings using Raspberry Pi, the problem of driver attention in maritime navigation systems is solved, providing real-time non-visual warnings, reducing collision risks and system costs.

CN120977146APending Publication Date: 2025-11-18DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511133045.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing maritime navigation systems rely on visual signals, which requires drivers to maintain concentration for extended periods, leading to fatigue. There is a lack of effective early warning methods other than visual ones, as well as a lack of low-cost, easily deployable automatic early warning equipment.

Method used

By analyzing AIS information in real time using Raspberry Pi, calculating the distance and time to the target ship, generating voice warnings, and combining them with collision avoidance rules, non-visual warnings are provided.

Benefits of technology

It enables real-time automatic voice warnings, reduces the risk of driver fatigue, lowers system construction costs, and enhances situational awareness capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120977146A_ABST
    Figure CN120977146A_ABST
Patent Text Reader

Abstract

The invention provides a Raspberry Pi-based navigation situation voice automatic early warning method, which comprises the following steps of: reading an NMEA0183 statement output by an AIS (Automatic Identification System) receiver, analyzing to obtain dynamic and static information of each target, and storing the dynamic and static information into a memory list by taking MMSI (Minimum Mobile Subscriber Identity) as an index; by taking the position of the ship as an original point, taking the heading of the ship as an x axis of a polar coordinate system and taking a starboard as a y axis, calculating the distance and the orientation of each target relative to the ship in the memory list, filtering out the targets in a target filtering range according to a preset Range threshold, and forming a temporary drawing list; calculating the DCPA and TCPA of each target in the temporary drawing list in real time, comparing the DCPA and TCPA with an alarm threshold value and an early warning threshold value preset by a user, and marking the target as an alarm state or an early warning state according to a comparison result; aiming at the target marked as the alarm state or the early warning state, generating a structured text field; and inputting the structured text fields into a voice synthesis module, and generating and playing complete early warning voice in real time by splicing off-line stored fixed audio paragraphs.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of maritime navigation traffic control, in particular, especially relates to a navigation situation voice automatic warning method and device based on a Raspberry Pi. BACKGROUND

[0002] The automatic identification system (AIS) is a kind of broadcast communication and navigation technology based on very high frequency (VHF) data link, which can broadcast the dynamic information (position, heading, speed) and static information (ship name, size, destination port, etc.) of the ship at a fixed period, and meanwhile receive the same kind of information from surrounding ships, to provide real-time and shared navigation situation data for maritime traffic participants.

[0003] At present, the industry generally superimposes the received AIS text data through the shipborne radar or electronic chart display information system (ECDIS) to form a visual navigation situation map for the watch officer to manually interpret. When the ship is in a complex encounter situation, night navigation or adverse weather conditions, the driver needs to continuously watch the screen and judge the collision risk combined with his own experience, and then take measures according to the International Regulations for Preventing Collisions at Sea. The whole process mainly inputs visual information and completely depends on the attention and experience level of the driver.

[0004] The traditional monitoring means mainly depends on visual signals (such as radar map, chart display, etc.), which has the following limitations: Navigation situation awareness depends on the experience of the driver: at present, the driver must maintain a high degree of concentration during navigation duty, especially in complex encounter situations, night or adverse weather conditions, long-term vigilance is easy to cause fatigue and lead to inattention and judgment errors, and lack of navigation experience may also cause situation judgment errors; Lack of effective warning methods other than vision: the traditional system cannot provide a warning other than vision when the operator does not check the screen, and it is easy to produce dangerous situations when the driver is not concentrated or does not check the radar and chart screen in time; Lack of low-cost, easy-to-deploy automatic warning devices: at present, there is a lack of non-intrusive, low-cost, easy-to-deploy and easy-to-use automatic warning devices for navigation situation. SUMMARY

[0005] In view of the above technical problems, a navigation situation voice automatic warning method and device based on a Raspberry Pi are provided. The method of the present application realizes the monitoring of the dynamic information of surrounding ships, situation visualization and voice automatic warning function by real-time receiving and analyzing AIS (automatic ship identification system) information of the ship and using the real-time data processing capability of the Raspberry Pi side.

[0006] The technical means adopted by the present application are as follows: A Raspberry Pi-based navigation situation voice automatic warning method, comprising: S1, reading the NMEA0183 statement output by the AIS receiver through the Raspberry Pi serial port, analyzing to obtain the dynamic and static information of each target, and storing the dynamic and static information in the memory list with MMSI as the index; S2, taking the position of the ship as the origin, the bow of the ship as the x-axis of the polar coordinate system, and the starboard as the y-axis, calculating the distance and direction of each target in the memory list relative to the ship, and filtering out the targets located within the target filtering range (Range) according to the user's preset target filtering range (Range) threshold, forming a temporary drawing list; S3, for each target in the temporary drawing list, real-time calculation of its closest approach distance (DCPA) and closest approach time (TCPA), and comparison with the user's preset alarm threshold and warning threshold, and according to the comparison result, the target is marked as alarm state or warning state; S4, for the target marked as alarm state or warning state, generate a structured text field; S5, input the structured text field into the speech synthesis module, splice the offline stored fixed audio paragraph, real-time generate and play the complete warning voice.

[0007] Further, step S1 comprises: S11, after the automatic warning starts, receiving the user's setting and real-time adjustment of the warning threshold, the threshold includes the closest approach distance (DCPA), the closest approach time (TCPA), the alarm threshold and the warning threshold of the target filtering range (Range); S12, read and analyze the NMEA0183 statement received by the AIS receiver, and store the target dynamic and static information in the list in the memory with the parsed MMSI as the index.

[0008] Further, step S2 comprises: S21, traverse the target list in the memory, calculate the distance and angle of the target relative to the ship, and save the target with a relative distance within the range as a temporary drawing list through the target filtering range (Range) set by step S11; S22, according to the dynamic change of the target, real-time maintain the increase and deletion of elements of the temporary drawing list; S23, create a polar coordinate system with the position of the ship as the reference system origin, the bow of the ship as the reference system x-axis, and the starboard as the reference system y-axis, the maximum radius of the coordinate system is the target filtering range (Range), and according to the relative direction and distance of the target in the temporary drawing list, draw the pseudo radar chart of the target.

[0009] Further, step S3 comprises: S31, for each target in the temporary drawing list, calculate its closest point of approach distance (DCPA) and closest point of approach time (TCPA) in real time S32, traverse the closest point of approach distance (DCPA) and closest point of approach time (TCPA) in the temporary drawing list, and highlight the targets of different risk levels (alarm, early warning) in different colors according to the comparison results with the alarm and early warning threshold values.

[0010] Further, step S4 comprises: S41, traverse the closest point of approach distance (DCPA) and closest point of approach time (TCPA) of each target in the temporary drawing list; S42, when either the closest point of approach distance (DCPA) or the closest point of approach time (TCPA) is less than the user-set threshold value, generate a structured early warning text field for the closest point of approach distance (DCPA) and the closest point of approach time (TCPA) of the ship. S43, according to the relative position and motion direction of the target and the ship, consider the right-of-way and straight-ahead responsibility specified in the international maritime collision regulations, and generate a structured situation text field for the relative distance, bearing, ship name and responsibility of the ship.

[0011] Further, step S5 comprises: S51, the system stores offline audio broadcast paragraphs of existing formatted fields, including: Paragraph 1: "has collision risk, DCPA is"; Paragraph 2: "TCPA is"; Paragraph 3: "nautical miles"; Paragraph 4: "minutes"; Paragraph 5: "from the ship"; Paragraph 6: "bearing"; Paragraph 7: "wheel, should"; Paragraph 8: "give way"; Paragraph 9: "straight ahead"; S52, during online real-time calculation, according to whether the target list needs early warning, extract the distance, bearing, closest point of approach distance (DCPA), closest point of approach time (TCPA) and ship name of the target, and determine the situation as giving way or straight ahead according to the rules, and use the speech synthesis (Text To Speech, TTS) technology to generate the "distance, bearing, closest point of approach distance (DCPA), closest point of approach time (TCPA) and ship name" five dynamic text data into corresponding voice paragraphs; S53, according to the sentence organization format specified in step S4, sequentially splice multiple audio broadcast paragraphs, and finally output to the audio playback module.

[0012] The application also provides a Raspberry Pi-based voyage situation voice automatic warning device, comprising: a Raspberry Pi 4B single-board computer configured to execute the Raspberry Pi-based voyage situation voice automatic warning method; a dual-channel AIS receiver and an AIS antenna connected with a Raspberry Pi serial port and configured to receive NMEA0183 sentences; a 5-inch touch display screen connected with a Raspberry Pi HDMI and USB interface and configured to display a pseudo radar chart and receive threshold input; a USB audio module and a loudspeaker connected with a Raspberry Pi USB interface and configured to play a warning voice; a 6V voltage stabilizing module configured to convert an external DC power supply into a working voltage required by the Raspberry Pi and the AIS receiver; The device is connected with an external power supply through a single power supply interface, and does not need to make any hardware modification to original equipment of a ship.

[0013] Further, the Raspberry Pi 4B single-board computer realizes NMEA0183 sentence analysis by calling a pyais library through a Python script, realizes pseudo radar chart drawing by calling a matplotlib library, and realizes voice synthesis by calling a pyttsx3 or similar TTS library, and all software is stored in a Raspberry Pi micro-SD card and automatically started and run by power-on.

[0014] Further, the touch display screen and the Raspberry Pi transmit video signals through an HDMI and transmit touch signals through a USB, and a display screen interface comprises: a pseudo radar chart display area; a target filtering range (Range) sliding bar with a value range of 0-20 nautical miles; a closest point of approach (DCPA) alarm sliding bar with a value range of 0-4 nautical miles; a closest point of approach (DCPA) warning sliding bar with a value range of 0-4 nautical miles; a closest point of time (TCPA) alarm sliding bar with a value range of 0-30 minutes; a closest point of time (TCPA) warning sliding bar with a value range of 0-30 minutes; Adjustment of any threshold takes effect immediately when the sliding bar is released and updates the pseudo radar chart and risk state.

[0015] Further, the Raspberry Pi 4B single-board computer, the dual-channel AIS receiver, the 5-inch touch display screen, the USB audio module and the 6V voltage stabilizing module are installed in the same waterproof shell, the shell is provided with only one power supply input interface and one AIS antenna interface, the overall weight is less than 500 g, the volume is less than 15 cm × 10 cm × 6 cm, and the deployment requirement of plug and play is met.

[0016] Compared with the prior art, the present invention has the following advantages: 1. This invention can realize real-time automatic voice warning. By automatically calculating the target vessel's DCPA / TCPA and comparing it with the alarm threshold, it generates and broadcasts structured warning voice data in real time. Combined with collision avoidance rules, it clarifies the division of responsibilities. By supplementing the warning information of the auditory modality, it effectively reduces the potential collision risk that may be caused by the driver's lack of concentration during the shift, and avoids human misjudgment of the situation to a certain extent.

[0017] 2. This invention uses a Raspberry Pi to complete the core computing functions, combined with an AIS receiver, display screen, and audio module. It achieves plug-and-play functionality through a single power supply interface, eliminating the need to modify the ship's existing equipment. This significantly reduces system construction costs and deployment difficulty, and has good application and promotion value.

[0018] 3. This invention generates a pseudo radar image in real time to reflect the dynamics of targets around the ship. A polar coordinate system is established with the ship as the origin and the bow as the reference. The relative position and movement trend of the targets are displayed in real time. Different colors are used to intuitively represent the risk level, thereby enhancing the situational awareness of the crew.

[0019] Based on the above reasons, this invention can be widely applied in fields such as maritime navigation and traffic control. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart of the method of the present invention.

[0022] Figure 2 This is the hardware architecture of the device of the present invention.

[0023] Figure 3 The pseudo radar image generated by the present invention is provided for embodiments of the present invention. Detailed Implementation

[0024] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative efforts should fall into the protection scope of the present application.

[0025] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0026] As shown in Figure 1 The present application provides a Raspberry Pi-based navigation situation voice automatic warning method, which comprises: S1, reading the NMEA0183 statement output by the AIS receiver through the Raspberry Pi serial port, analyzing to obtain the dynamic and static information of each target, and storing the dynamic and static information in the memory list with MMSI as the index; S2, taking the position of the ship as the origin, the bow of the ship as the x-axis of the polar coordinate system, and the starboard as the y-axis, calculating the distance and direction of each target in the memory list relative to the ship, and filtering out the targets located within the target filtering range (Range) according to the user's preset target filtering range (Range) threshold, to form a temporary drawing list; S3, for each target in the temporary drawing list, real-time calculation of the closest point of approach distance (DCPA) and the closest point of approach time (TCPA), and comparison with the user's preset alarm threshold and warning threshold, and marking the target as an alarm state or a warning state according to the comparison result; S4, generating a structured text field for the target marked as an alarm state or a warning state; S5, inputting the structured text field into a voice synthesis module, generating and playing a complete warning voice in real time by splicing the offline stored fixed audio paragraphs.

[0027] In specific implementation, as a preferred embodiment of the present application, step S1 comprises: S11, after the automatic early warning starts, receiving user's setting and real-time adjustment of the early warning threshold, the threshold including the closest point of approach distance (DCPA), the closest point of approach time (TCPA), the alarm threshold and the early warning threshold of the target filtering range (Range); S12, reading and analyzing the NMEA0183 statement received by the AIS receiver, and storing the target dynamic and static information into the list in the memory by using the parsed MMSI as the index.

[0028] In the implementation, as a preferred embodiment of the present application, step S2 comprises: S21, traversing the target list in the memory, calculating the distance and angle of the target relative to the ship, and saving the target with the relative distance within the target filtering range (Range) set by step S11 as a temporary drawing list; S22, according to the dynamic change of the target, maintaining the addition and deletion of the elements of the temporary drawing list in real time; S23, creating a polar coordinate system with the position of the ship as the origin of the reference system, the bow of the ship as the x-axis of the reference system, and the starboard as the y-axis of the reference system, the maximum radius of the coordinate system being the target filtering range (Range), and drawing the pseudo-radar graph of the target according to the relative position and distance of the target in the temporary drawing list.

[0029] In the implementation, as a preferred embodiment of the present application, step S3 comprises: S31, for each target in the temporary drawing list, calculating the closest point of approach distance (DCPA) and the closest point of approach time (TCPA) in real time S32, traversing the closest point of approach distance (DCPA) and the closest point of approach time (TCPA) in the temporary drawing list, and according to the comparison result with the alarm and early warning threshold, highlighting the targets of different risk levels (alarm and early warning) with different colors.

[0030] In the implementation, as a preferred embodiment of the present application, step S4 comprises: S41, traversing the closest point of approach distance (DCPA) and the closest point of approach time (TCPA) of each target in the temporary drawing list; S42, when either the closest point of approach distance (DCPA) or the closest point of approach time (TCPA) is less than the user-set threshold, generating a structured early warning text field for the closest point of approach distance (DCPA) and the closest point of approach time (TCPA) of the ship, the format being "with collision risk, DCPA is ____ nautical miles, TCPA is ____ minutes"; S43. Based on the relative position and direction of motion of the target and the ship, and considering the responsibilities for giving way and straight-ahead navigation as stipulated in the International Regulations for Preventing Collisions at Sea, generate a structured situational text field containing the relative distance, bearing, ship name, and responsibility of the target, in the format "The ____ vessel at ____ nautical miles ____ bearing of this ship shall give way / straight-ahead navigation".

[0031] In a specific implementation, as a preferred embodiment of the present invention, step S5 includes: S51. Audio playback segments with existing formatted fields are stored offline within the system, including: Paragraph 1: "Contains a collision risk, DCPA is"; Paragraph 2: "TCPA is"; Paragraph 3: "nautical miles"; Paragraph 4: "Minutes"; Paragraph 5: "Distance from this ship"; Paragraph 6: "directional"; Paragraph 7: "Wheel, should"; Paragraph 8: "Make way"; Paragraph 9: "Direct Flights"; S52. During the online real-time calculation process, depending on whether the target list requires an early warning, the target's distance, bearing, nearest encounter distance (DCPA), nearest encounter time (TCPA), and ship name are extracted. The situation is then determined according to rules to be either giving way or proceeding directly. Using text-to-speech (TTS) technology, the five dynamic text data items of "distance, bearing, nearest encounter distance (DCPA), nearest encounter time (TCPA), and ship name" are generated into corresponding speech segments. S53. According to the statement organization format specified in step S4, multiple audio broadcast segments are spliced ​​together in sequence and finally output to the audio playback module.

[0032] This invention also provides a navigation situation voice automatic warning device based on Raspberry Pi, such as... Figure 2 As shown, it includes: A Raspberry Pi 4B single-board computer is used to execute the Raspberry Pi-based automatic navigation situation voice warning method. A dual-channel AIS receiver and AIS antenna, connected to the Raspberry Pi serial port, are used to receive NMEA0183 statements; A 5-inch touchscreen display connects to the Raspberry Pi via HDMI and USB ports to display pseudo radar charts and receive threshold inputs; A USB audio module and speaker are connected to the Raspberry Pi's USB interface to play warning voice messages; The 6V voltage regulator module is used to convert the external DC power supply into the operating voltage required by the Raspberry Pi and AIS receiver; The device is connected to an external power supply through a single power interface, and does not need to modify the original hardware of the ship.

[0033] In a specific implementation, as a preferred embodiment of the application, the Raspberry Pi 4B single-board computer realizes NMEA0183 statement analysis by calling the pyais library through a Python script, realizes pseudo-radar chart drawing by calling the matplotlib library, and realizes voice synthesis by calling the pyttsx3 or similar TTS library. All the software is stored in the micro-SD card of the Raspberry Pi and is automatically started and run by power-on.

[0034] In a specific implementation, as a preferred embodiment of the application, the touch display screen and the Raspberry Pi transmit video signals through HDMI and transmit touch signals through USB. The display screen interface includes: a pseudo-radar chart display area; a target filtering range (Range) slider bar with a value range of 0-20 nautical miles; a closest point of approach (DCPA) alarm slider bar with a value range of 0-4 nautical miles; a closest point of approach (DCPA) warning slider bar with a value range of 0-4 nautical miles; a closest point of approach time (TCPA) alarm slider bar with a value range of 0-30 minutes; a closest point of approach time (TCPA) warning slider bar with a value range of 0-30 minutes; Any adjustment of the threshold takes effect immediately when the slider bar is released and updates the pseudo-radar chart and the risk state.

[0035] In a specific implementation, as a preferred embodiment of the application, the Raspberry Pi 4B single-board computer, the dual-channel AIS receiver, the 5-inch touch display screen, the USB audio module, and the 6V voltage stabilizing module are installed in the same waterproof shell. The shell is provided with only one power input interface and one AIS antenna interface. The overall weight is less than 500 g, and the volume is less than 15 cm × 10 cm × 6 cm, meeting the plug-and-play deployment requirements.

[0036] Embodiment In this embodiment, the python reads the values of the slider bars in real time and saves and updates the threshold values warn_DCPA, alarm_DCPA, warn_TCPA, alarm_TCPA, and target_Range; The pyais and pyserial software libraries based on python are used to realize reading and analysis of serial AIS data, separate the data of the ship and the target according to MMSI, and store the analyzed target data in a list list_all_targets with MMSI as the index. Traverse the target list in memory, calculate the distance of the target relative to the ship and angle , save the target with relative distance within the threshold range target_Range as a temporary drawing list list_temp_targets through the 5 thresholds set in the previous step, maintain the increase and deletion of elements in this list according to the dynamic changes of the target, and create a polar coordinate system with the ship's position as the origin of the reference system, the ship's heading as the x-axis of the reference system, and the starboard as the y-axis of the reference system based on the target position postion, speed direction spd_dir and size spd_val in the temporary list, with the maximum radius of the coordinate system being target_Range; Draw the pseudo radar chart of the target according to the relative position and distance of the target and the ship, traverse the target DCPA and TCPA in the above-mentioned temporary list list_temp_targets, and highlight the targets with different risk levels with different colors according to the comparison results with the alarm and warning threshold values, wherein the warning information is displayed in yellow and the alarm information is displayed in red, and the effect is shown as Figure 3 ; Traverse the target DCPA and TCPA in the above-mentioned temporary list list_temp_targets, and generate a structured warning text field when either DCPA or TCPA is less than the user-set threshold, such as: "collision risk, DCPA is 0.2 nautical miles, TCPA is 8.1 minutes", according to the relative position and motion direction of the target and the ship, considering the right-of-way and straight-ahead responsibility specified in the international maritime collision regulations, generate a structured situation text field of ship relative distance, bearing, ship name and responsibility, such as: "TEST ship 0.5 nautical miles away from the ship at 047 bearing, should straight ahead.", Finally, combine the two structured statements and output the text data: "TEST ship 0.5 nautical miles away from the ship at 047 bearing, should straight ahead. Collision risk, DCPA is 0.2 nautical miles, TCPA is 8.1 minutes"; The system has offline stored audio broadcast paragraphs of existing formatted fields, and performs voice synthesis on the above-mentioned combined text to generate an audio file with timestamp as the command, such as alarm_20250203083245.mp3, and finally output to the audio playback module.

[0037] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for automatic voice-based early warning of navigation situation based on Raspberry Pi, characterized in that, include: S1. Read the NMEA0183 statement output by the AIS receiver through the Raspberry Pi serial port, parse it to obtain the dynamic and static information of each target, and store the dynamic and static information into a memory list with MMSI as the index. S2. Using the ship's position as the origin, the ship's heading as the x-axis of the polar coordinate system, and the starboard side as the y-axis, calculate the distance and bearing of each target in the memory list relative to the ship, and filter out targets within the target filtering range according to the user's preset target filtering range threshold to form a temporary drawing list. S3. For each target in the temporary drawing list, calculate its nearest encounter distance and nearest encounter time in real time, and compare them with the user's preset alarm threshold and warning threshold. Based on the comparison results, mark the target as alarm status or warning status. S4. Generate structured text fields for targets marked as alarm or warning status; S5. Input the structured text field into the speech synthesis module, and generate and play the complete warning voice in real time by splicing fixed audio segments stored offline.

2. The automatic voice warning method for navigation situation based on Raspberry Pi according to claim 1, characterized in that, Step S1 includes: S11. After the automatic warning starts, it receives the user's settings and real-time adjustments of the warning threshold. The thresholds include the nearest encounter distance, the nearest encounter time, the alarm threshold value of the target filtering range, and the warning threshold value. S12. Read and parse the NMEA0183 statement received by the AIS receiver, and store the target dynamic and static information into a list in memory using the parsed MMSI as an index.

3. The automatic voice warning method for navigation situation based on Raspberry Pi according to claim 1, characterized in that, Step S2 includes: S21. Traverse the target list in memory, calculate the distance and angle of the target relative to the ship, and save the targets within the relative distance range set in step S11 as a temporary drawing list. S22. Based on the dynamic changes of the target, maintain the addition and deletion of elements in the temporary drawing list in real time; S23. Create a polar coordinate system with the ship's position as the origin of the reference frame, the ship's heading as the x-axis of the reference frame, and the starboard side as the y-axis of the reference frame. The maximum radius of the coordinate system is the target filtering range. Based on the relative bearings and distances of the targets in the temporary drawing list, draw a pseudo radar image of the targets.

4. The automatic voice warning method for navigation situation based on Raspberry Pi according to claim 1, characterized in that, Step S3 includes: S31. For each target in the temporary drawing list, calculate its nearest encounter distance and nearest encounter time in real time; S32. Traverse the nearest encounter distance and nearest encounter time in the temporary drawing list, and highlight targets of different risk levels with different colors according to the comparison results with alarm and warning threshold values.

5. The automatic voice warning method for navigation situation based on Raspberry Pi according to claim 1, characterized in that, Step S4 includes: S41. Iterate through the nearest encounter distance and nearest encounter time of each target in the temporary drawing list; S42. When either the nearest encounter distance or the nearest encounter time is less than the user-defined threshold, the nearest encounter distance and the nearest encounter time of the ship will be used to generate a structured warning text field. S43. Based on the relative position and direction of motion of the target and the ship, and considering the responsibilities for giving way and straight course as stipulated in the International Regulations for Preventing Collisions at Sea, generate a structured situational text field for the relative distance, bearing, ship name and responsibilities of the vessels.

6. The automatic voice warning method for navigation situation based on Raspberry Pi according to claim 1, characterized in that, Step S5 includes: S51. Audio playback segments with existing formatted fields are stored offline within the system, including: Paragraph 1: "Collapse risk, DCPA is"; Paragraph 2: "TCPA is"; Paragraph 3: "nautical miles"; Paragraph 4: "Minutes"; Paragraph 5: "Distance from this ship"; Paragraph 6: "directional"; Paragraph 7: "Wheel, should"; Paragraph 8: "Make way"; Paragraph 9: "Direct Flights"; S52. During the online real-time calculation process, depending on whether the target list requires an early warning, the distance, bearing, nearest encounter distance, nearest encounter time, and ship name of the target are extracted. The situation is determined according to the rules to be either giving way or sailing directly. Using speech synthesis technology, the five dynamic text data items of "distance, bearing, nearest encounter distance, nearest encounter time, and ship name" are generated into corresponding speech segments. S53. According to the statement organization format specified in step S4, multiple audio broadcast segments are spliced ​​together in sequence and finally output to the audio playback module.

7. A navigation situation voice automatic early warning device based on Raspberry Pi, characterized in that, include: A Raspberry Pi 4B single-board computer for performing the method according to any one of claims 1 to 6; A dual-channel AIS receiver and AIS antenna, connected to the Raspberry Pi serial port, are used to receive NMEA0183 statements; A 5-inch touchscreen display connects to the Raspberry Pi via HDMI and USB ports to display pseudo radar charts and receive threshold inputs; A USB audio module and speaker are connected to the Raspberry Pi's USB interface to play warning voice messages; The 6V voltage regulator module is used to convert the external DC power supply into the operating voltage required by the Raspberry Pi and AIS receiver; The device connects to an external power source via a single power interface, requiring no hardware modifications to the ship's existing equipment.

8. The apparatus according to claim 7, characterized in that, The Raspberry Pi 4B single-board computer uses Python scripts to call the pyais library to parse NMEA0183 statements, calls the matplotlib library to draw pseudo radar charts, and calls pyttsx3 or similar TTS libraries to synthesize speech. All software is stored on the Raspberry Pi micro-SD card and runs automatically upon power-on of the Raspberry Pi.

9. The apparatus according to claim 7, characterized in that, The touchscreen displays and the Raspberry Pi communicate via HDMI for video signal transmission and USB for touch signal transmission. The display interface includes: The pseudo-radar map shows the area; Target filtering range slider, with a value range of 0~20 nautical miles; The distance alarm slider will appear recently, with a value range of 0 to 4 nautical miles; The distance warning slider will appear soon, with a value range of 0 to 4 nautical miles. Recently, a time alarm slider has been encountered, with a value range of 0 to 30 minutes; Recently, you will encounter a time-based warning slider, with a value range of 0 to 30 minutes; Any threshold adjustment takes effect immediately upon release of the slider and updates the pseudo radar chart and risk status.

10. The apparatus according to claim 7, characterized in that, The Raspberry Pi 4B single-board computer, dual-channel AIS receiver, 5-inch touch screen, USB audio module and 6V voltage regulator module are installed in the same waterproof housing. The housing has only one power input interface and one AIS antenna interface. The overall weight is less than 500 grams and the size is less than 15 cm × 10 cm × 6 cm, which meets the requirements of plug and play deployment.