Underwater sensor data receiving method and device

By detecting the start bit and stop bit in the serial port protocol, setting a timestamp, and completing data reception and packaging within the timeout time, the problem of low data reception efficiency of different sensors in underwater navigation is solved, and higher time accuracy and navigation system reliability are achieved.

CN120074685APending Publication Date: 2025-05-30QINGDAO INTELLIGENT NAVIGATION & CONTROL RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510107560.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In underwater navigation, it is difficult for the prior art to effectively receive data from different sensors, especially because the data protocol is not uniform, the data length is not uniform, and the data length of the same sensor is not fixed, resulting in low efficiency in timestamp addition and data reception.

Method used

A method of underwater sensor data reception is adopted to detect the start bit and stop bit in the serial port protocol, set the time stamp, and complete the data reception and packaging within the timeout period to ensure the effective reception of different sensor data.

Benefits of technology

It realizes timely time stamp addition and effective reception of different sensor data, improving the time accuracy of sensor data and the reliability of navigation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074685A_ABST
    Figure CN120074685A_ABST
Patent Text Reader

Abstract

The invention discloses an underwater sensor data receiving method and device, and the method comprises the following steps: S1, setting a timestamp when a start bit is detected for the first time, and starting to receive data; s2, when a stop bit is detected, timing is carried out; and S3, when the timeout duration is over, if a new start bit is not detected, packaging all the received data. The scheme provided by the invention is used for an underwater navigation unit, can add timestamps to data from different sensors in time, and can effectively receive data with non-uniform data protocols and non-uniform data lengths of different sensors and receive data with non-fixed data lengths of the same sensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of underwater data transmission, and particularly to a method and device for receiving underwater sensor data. Background Art

[0002] When performing underwater navigation, a navigation calculation unit needs to receive data from sensors such as LBL and DVL to calculate the navigation result. The calculation of the navigation result requires not only sensor data but also the time when the sensor collects data, and the accuracy of the time affects the accuracy of the navigation result. There are various underwater sensors, the data protocols of different sensors are not unified, the data lengths are not unified, and in addition, the data length of the same sensor is not fixed.

[0003] Therefore, how to add timestamps to data from different sensors in a timely manner, and how to receive data with inconsistent data protocols and data lengths from different sensors, as well as data with an unfixed data length for the same sensor.

[0004] In view of this, this invention is specifically proposed. Summary of the Invention

[0005] The purpose of the present invention is to solve the disadvantages existing in the prior art, and to propose a method and device for receiving underwater sensor data for an underwater navigation unit, which can add timestamps to data from different sensors in a timely manner, and can effectively receive data with inconsistent data protocols and data lengths from different sensors, as well as receive data with an unfixed data length for the same sensor.

[0006] To achieve the above purpose, the present invention adopts the following technical solutions:

[0007] A method for receiving underwater sensor data, which is applied to the reception of serial port protocol data, includes the following steps:

[0008] S1: When the start bit is first detected, set the timestamp and start receiving data;

[0009] S2: When the stop bit is detected, start timing;

[0010] S3: If a new start bit is not detected when the timeout duration ends, pack all the received data.

[0011] Further, the S3 includes the following steps:

[0012] S31: If a new start bit is detected within the timeout duration, continue to receive data;

[0013] S32: If a new start bit is not detected within the timeout duration, pack all the received data.

[0014] Further, the timeout duration is the time taken to transmit 2 Bits.

[0015] Further, in S1, the timestamp is obtained through the following steps:

[0016] S11: Obtain the PPS signal;

[0017] S12: Set the timestamp according to the time signal combined by the PPS signal and the counter signal.

[0018] Further, S11 includes the following steps:

[0019] S111: Obtain the PPS signal;

[0020] S112: Clear the counter signal to zero.

[0021] Further, an acceptance layer and a logic layer are provided. The acceptance layer is used to receive data and detect the start bit and stop bit of the data, and the logic layer is used to set the timestamp and pack the data;

[0022] In S1, when the acceptance layer first detects the start bit, it notifies the logic layer to set the timestamp and starts receiving data;

[0023] In S2, when the acceptance layer detects the stop bit, it starts timing the timeout duration;

[0024] In S3, if the acceptance layer detects a new start bit within the timeout duration, it continues to receive data; if the acceptance layer does not detect a new start bit when the timeout duration ends, it notifies the logic layer to pack all the received data.

[0025] To achieve the above object, the present invention also adopts the following technical solution:

[0026] An underwater sensor data receiving device, comprising:

[0027] At least one processing module;

[0028] And a storage module communicatively connected to the at least one processing module;

[0029] Wherein, the storage module stores instructions executable by the at least one processing module, and the instructions are executed by the at least one processing module so that the at least one processing module can execute the steps of any one of the coastal beach system control methods provided by the present invention.

[0030] Further, it includes:

[0031] The ZYNQ chip, where the processing module and the storage module are arranged on the ZYNQ chip.

[0032] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0033] 1. In the solution of the present invention, S1 - S3 are executed in a loop to pack a frame of received data. The first detection of the start bit in S1 refers to the time point when the start bit is re - detected after the packing of the previous frame of data is completed, that is, the first byte of the new frame of data received. A timestamp is added when the start bit of the first byte of the new frame of data is received, preventing delay and improving the time accuracy of the sensor to the signal level, and thus being able to provide more reliable sensor data for the navigation system.

[0034] 2. In the solution of the present invention, when the stop bit is detected, it means that the reception of a byte of data is completed, and at this time, timing is carried out. If a start is detected within the timeout duration, it means that the frame of data has not been completely received, and at this time, new bytes continue to be received. If no new start bit is detected at the end of the timeout duration, it means that the frame of data has been completely received, and at this time, the bytes from the byte where the start bit was first detected in S1 to the last byte can be packed, thus completing the packing of a frame of data. Through the above process, the present invention can effectively receive data with inconsistent data protocols and data lengths from different sensors, as well as data with variable data lengths from the same sensor, without concerning the specific content of the data protocol and the data length. Description of the Drawings

[0035] Figure 1 It is a flowchart of the underwater sensor data receiving method;

[0036] Figure 2 It is the simulation verification of the method of this embodiment Figure 1 ;

[0037] Figure 3 It is the simulation verification of the method of this embodiment Figure 2 。 Detailed Embodiments

[0038] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.

[0039] Embodiment 1:

[0040] An underwater sensor data receiving method, which is applied to the reception of serial port protocol data, includes the following steps:

[0041] S1: When the start bit is first detected, set the timestamp and start receiving data.

[0042] The interfaces of sensors such as LBL and DVL are all serial ports. When the serial port protocol sends data, it consists of a start bit, data bits, and a stop bit.

[0043] In this embodiment, the loop of S1 - S3 is executed to pack a frame of received data. The first detection of the start bit in S1 means that after the previous frame of data is packed, the start bit is detected again, that is, the first byte of the new frame of data is received.

[0044] In this embodiment, adding a timestamp when the start bit of the first byte of the new frame of data is received prevents delay, improves the time accuracy of the sensor to the signal level, and thus can provide more reliable sensor data for the navigation system.

[0045] S2: When the stop bit is detected, start timing for the timeout period.

[0046] S3: If no new start bit is detected when the timeout duration ends, pack all the received data.

[0047] In this embodiment, detecting the stop bit means that the reception of one byte of data is completed, and timing is performed at this time. If a start bit is detected within the timeout duration, it means that the frame of data has not been completely received, and reception continues at this time. If no new start bit is detected when the timeout duration ends, it means that the frame of data has been completely received. At this time, the bytes from the byte where the start bit was first detected in S1 to the last byte can be packed, thereby completing the packing of a frame of data. Through the above process, this embodiment can effectively receive data with inconsistent data protocols and data lengths from different sensors, as well as data with variable data lengths from the same sensor, without caring about the specific content of the data protocol and the data length.

[0048] In an alternative embodiment, S3 includes the following steps: S31: If a new start bit is detected within the timeout duration, continue to receive data; S32: If no new start bit is detected within the timeout duration, pack all the received data.

[0049] In an alternative embodiment, the timeout duration is the time consumed for transmitting 2 Bits.

[0050] In this alternative embodiment, the timeout duration is set according to the serial port baud rate. The timeout duration is set to the time consumed for transmitting 2 Bits. The counter is maintained by the FPGA crystal oscillator. Within the timeout duration, the crystal oscillator has good stability. The timeout duration is the time consumed for transmitting 2 Bits, and serious cumulative time errors will not be caused.

[0051] In an optional embodiment, the timestamp is obtained in S1 through the following steps: S11: Obtain a PPS signal; S12: Set the timestamp according to the time signal combined by the PPS signal and the counter signal.

[0052] In this optional embodiment, the seconds-level time is accumulated through the PPS signal received from the outside to calculate the hours, minutes, and seconds, and the time within the second is accumulated through the internal counter signal. The combination of the two completes the setting of the timestamp.

[0053] In this optional embodiment, setting the timestamp according to the time signal combined by the PPS signal and the counter signal has a lower cost, and the time accuracy can reach the time setting scheme of hardware synchronization.

[0054] In an optional embodiment, S11 includes the following steps: S111: Obtain a PPS signal; S112: Clear the counter signal.

[0055] In this optional embodiment, after obtaining the PPS signal, the counter signal is cleared. On the one hand, it can prevent the cumulative error of the crystal oscillator from occurring over a long time; on the other hand, if the PPS signal is lost due to an unexpected situation, the counter can continue to maintain the time, ensuring the accuracy of the time system to the greatest extent possible.

[0056] In an optional embodiment, a receiving layer and a logic layer are set. The receiving layer is used to receive data and detect the start bit and stop bit of the data. The logic layer is used to set the timestamp and pack the data; in S1, when the receiving layer first detects the start bit, it notifies the logic layer to set the timestamp and starts to receive data; in S2, when the receiving layer detects the stop bit, it starts timing; in S3, if the receiving layer detects a new start bit within the timeout duration, it continues to receive data; if the receiving layer does not detect a new start bit when the timeout duration ends, it notifies the logic layer to pack all the received data.

[0057] In this optional embodiment, setting the receiving layer and the logic layer, where the receiving layer is used to receive data and detect the start bit and stop bit of the data, and the logic layer is used to set the timestamp and pack the data, can make the program clearer.

[0058] To verify the effectiveness of this implementation method, a simulation verification is carried out on it, and the verification results are as Figure 2 and 3 shown ( Figure 3(which is the simulation result after proportional amplification). The simulation result shows that the method of this embodiment can effectively receive data with inconsistent sensor data protocols and data lengths, as well as data with variable lengths from the same sensor, without caring about the specific content of the data protocol and the data length.

[0059] Embodiment 2:

[0060] An underwater sensor data receiving device, comprising:

[0061] At least one processing module;

[0062] And a storage module communicatively connected to the at least one processing module;

[0063] Wherein, the storage module stores instructions executable by the at least one processing module, and the instructions are executed by the at least one processing module, so that the at least one processing module can execute the steps of any one of the underwater sensor data receiving methods provided in Embodiment 1.

[0064] In an optional embodiment, it includes:

[0065] A ZYNQ chip, where the processing module and the storage module are disposed on the ZYNQ chip.

[0066] In this embodiment, the ZYNQ chip receives the PPS signal and the sensor signal, that is, the input includes the PPS signal and the sensor signal; in addition, the calculation of the timeout duration and the accumulation of the time within seconds when setting the timestamp are implemented by the hardware counter of the FPGA.

[0067] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.

Claims

1. A method for receiving underwater sensor data, characterized in that: Applied to receiving serial port protocol data, including the following steps: S1: When the start bit is detected for the first time, the timestamp is set and data reception begins; S2: When the stop position is detected, timing is performed; S3: If no new start bit is detected at the end of the timeout period, all received data will be packaged.

2. The method for receiving underwater sensor data according to claim 1, characterized in that: The S3 comprises the following steps: S31: If a new start bit is detected within the timeout period, data continues to be received; S32: If no new start bit is detected within the timeout period, all received data are packaged.

3. The method for receiving underwater sensor data according to claim 1 or 2, characterized in that: The timeout duration is the time it takes to transmit 2 bits.

4. The method for receiving underwater sensor data according to claim 1, characterized in that: In S1, the timestamp is obtained by the following steps: S11: Get PPS signal; S12: Set a timestamp according to a time signal obtained by combining the PPS signal and the counter signal.

5. The method for receiving underwater sensor data according to claim 4, characterized in that: The S11 comprises the following steps: S111: Acquire PPS signal; S112: Clear the counter signal.

6. The method for receiving underwater sensor data according to claim 4, characterized in that: Set up the receiving layer and the logic layer. The receiving layer is used to receive data and detect the start and stop bits of the data. The logic layer is used to set the timestamp and data packaging. In S1, when the receiving layer detects the start bit for the first time, it notifies the logical layer to set the timestamp and start receiving data; In S2, when the receiving layer detects the stop bit, it starts counting the timeout period. In S3, if the receiving layer detects a new start bit within the timeout period, it continues to receive data; if the receiving layer does not detect a new start bit at the end of the timeout period, it notifies the logical layer to package all received data.

7. An underwater sensor data receiving device, characterized in that: include: at least one processing module; and, a storage module communicatively connected to the at least one processing module; The storage module stores instructions executable by the at least one processing module, and the instructions are executed by the at least one processing module so that the at least one processing module can execute the steps of the coastal beach system control method described in any one of claims 1 to 6.

8. The underwater sensor data receiving device according to claim 7, characterized in that: include: ZYNQ chip, the processing module and the storage module are arranged on the ZYNQ chip.