Underwater clock synchronization method, underwater networking system and storage medium
The underwater clock synchronization method using two-step messaging solves the problem of high network traffic in underwater communication, enables clock synchronization for multi-UUV collaborative operations, and improves the communication efficiency of underwater networking systems.
Patent Information
- Application Number
- CN202310227593.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-02-28
AI Technical Summary
In existing underwater communication scenarios, clock synchronization methods require four message steps, resulting in a large amount of network communication and making it difficult to meet the needs of multi-UUV collaborative operations.
A two-step underwater clock synchronization method is adopted, which involves sending delay request and delay response messages, recording the interval duration to determine clock error information, and updating the local clock to achieve synchronization.
It reduces the network traffic of underwater acoustic communication, improves the communication collaboration efficiency of underwater networking systems, and adapts to the extremely low bandwidth underwater environment.
Smart Images

Figure CN116208287B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of underwater communication, in particular to an underwater clock synchronization method, an underwater networking system and a storage medium. BACKGROUND
[0002] In an underwater environment, communication means such as radio or laser has a large signal attenuation in underwater transmission and a limited action distance, and cannot effectively communicate underwater. Acoustic signals are used as the only and effective transmission carrier in seawater medium in underwater acoustic communication, and therefore underwater acoustic communication is often used in underwater equipment such as UUV (Unmanned Underwater Vehicle).
[0003] With the increasing complexity of underwater operations, single UUV-based underwater operations cannot meet the requirements of work efficiency, capacity, range, time and the like, and therefore the multi-UUV collaborative operation mode begins to appear. In the multi-UUV collaborative operation process, the specific position and state of the UUV need to be worked by multiple UUVs in cooperation, so clock synchronization is very important in the collaborative system composed of multiple UUVs.
[0004] However, in the related art, at least 4 steps of messages are required to achieve clock synchronization, and for underwater communication scenarios, network traffic still needs to be reduced.
[0005] SUMMARY
[0006] The main purpose of the present application is to provide an underwater clock synchronization method, an underwater networking system and a storage medium, aiming at solving the technical problem of large network traffic of the 4-step message clock synchronization method in the existing underwater communication scenario.
[0007] To achieve the above purpose, the present application provides an underwater clock synchronization method used for a second underwater device, the method comprising:
[0008] sending a delay request message; wherein the delay request message comprises a first interval time length between a sending time of the second underwater device sending the delay request message and a set clock synchronization time;
[0009] when receiving the delay response message sent by the first underwater device, recording a fourth interval time length between the current time and the set clock synchronization time; wherein the delay response message comprises a second interval time length between a receiving time and the set clock synchronization time, and a third interval time length between the first underwater device receiving the delay request message and sending the delay response message; the receiving time is the time when the first underwater device receives the delay request message;
[0010] determine clock error information between the first underwater device and the second underwater device according to the first interval duration, the second interval duration, the third interval duration and the fourth interval duration;
[0011] update a local clock according to the clock error information, so as to synchronize the local clock with a clock of the first underwater device.
[0012] In an embodiment of the present application, the determining clock error information between the first underwater device and the second underwater device according to the first interval duration, the second interval duration, the third interval duration and the fourth interval duration comprises:
[0013] determining clock error information between the first underwater device and the second underwater device according to the first interval duration, the second interval duration, the third interval duration, the fourth interval duration and a first formula;
[0014] The first formula is:
[0015]
[0016] wherein, offest is clock error information, t1 is the first interval duration, t2 is the second interval duration, t3 is the third interval duration, and t4 is the fourth interval duration.
[0017] In an embodiment of the present application, the delay request packet and the delay response packet further comprise device identification information.
[0018] The recording of the fourth interval duration from the set clock synchronization time to the current time when the delay response packet sent by the first underwater device is received comprises:
[0019] extracting the device identification information of the delay response packet when the delay response packet is received;
[0020] recording the fourth interval duration from the set clock synchronization time to the current time when the device identification information matches the second underwater device.
[0021] In an embodiment of the present application, the first packet format of the delay request packet is: 1-bit packet type, 7-bit device identification information and 4-byte first interval duration.
[0022] In an embodiment of the present application, after the delay request packet is sent, the method further comprises:
[0023] If the delay response packet is not received within a preset time period after the sending time, the number of unanswered times is recorded, and the sending of the delay request packet is returned to perform;
[0024] When the delay response packet is received, the number of times is cleared.
[0025] When the number of times is greater than or equal to a preset threshold, the sending of the delay request packet is stopped, and alarm information is sent to the ground equipment.
[0026] In a second aspect, the application further provides an underwater clock synchronization method used for a first underwater equipment, the method comprising:
[0027] Monitoring whether a delay request packet sent by a second underwater equipment is received; wherein the delay request packet comprises a first interval time period between a sending time of the delay request packet sent by the second underwater equipment and a set clock synchronization time;
[0028] When the delay request packet is received, a current time is taken as a receiving time, and a second interval time period between the receiving time and the set clock synchronization time is obtained;
[0029] Sending a delay response packet to the second underwater equipment, so that the second underwater equipment records a fourth interval time period between a time of receiving the delay response packet and the set clock synchronization time, determines clock error information between the first underwater equipment and the second underwater equipment according to the first interval time period, the second interval time period, the third interval time period and the fourth interval time period, and updates a local clock according to the clock error information, so that the local clock and the clock of the first underwater equipment are synchronized; wherein the second interval time period is a time period between the receiving time of the delay request packet by the first underwater equipment and the set clock synchronization time, and the third interval time period is a time period between the receiving of the delay request packet by the first underwater equipment and the sending of the delay response packet.
[0030] In a possible embodiment of the application, a second packet format of the delay response packet is: 1-bit packet type, 7-bit device identification information, 4-byte second interval time period and 1-byte third interval time period.
[0031] In a possible embodiment of the application, the sending of the delay response packet to the second underwater equipment comprises:
[0032] If the delay response packet is not sent within a second preset time period after the receiving time, the second packet format is updated to obtain a new second packet format; the new second packet format comprises 2-byte third interval time period.
[0033] The new second message format is used to send the delay response message.
[0034] In a third aspect, the application further discloses an underwater networking system, comprising:
[0035] The first underwater device comprises a processor, a memory, and a computer program stored in the memory, and the computer program implements the steps of the underwater clock synchronization method when executed by the processor; and
[0036] The second underwater device is connected with the first underwater device through underwater acoustic communication, and comprises a processor, a memory, and a computer program stored in the memory, and the computer program implements the steps of the underwater clock synchronization method when executed by the processor.
[0037] In a fourth aspect, the application further discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program implements the underwater clock synchronization method when executed by a processor.
[0038] The underwater clock synchronization method provided by the application comprises the following steps: sending a delay request message; wherein the delay request message comprises a first interval time length between a sending time point of the second underwater device sending the delay request message and a set clock synchronization time point; when receiving a delay response message sent by the first underwater device, recording a fourth interval time length between a current time point and the set clock synchronization time point; wherein the delay response message comprises a second interval time length between a receiving time point and the set clock synchronization time point, and a third interval time length between the first underwater device receiving the delay request message and sending the delay response message; the receiving time point is a time point at which the first underwater device receives the delay request message; determining clock error information between the first underwater device and the second underwater device according to the first interval time length, the second interval time length, the third interval time length and the fourth interval time length; and updating a local clock according to the clock error information, so as to synchronize the local clock with a clock of the first underwater device.
[0039] Therefore, in the application, the existing clock synchronization method with four steps of message sending is simplified to a clock synchronization method with two steps of message sending, so as to reduce the network communication amount of underwater acoustic communication, and facilitate communication cooperation of the underwater networking system. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 An architecture schematic diagram of an underwater networking system is provided for an exemplary embodiment.
[0041] Figure 2 Fig. 1 is a structural schematic diagram of a water clock synchronization method according to an embodiment of the present application. Figure 1 Fig. 2 is a structural schematic diagram of a water clock synchronization method according to an embodiment of the present application.
[0042] Figure 3 Fig. 3 is a flowchart of a water clock synchronization method according to an embodiment of the present application.
[0043] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are merely intended to explain the present application and are not intended to limit the present application.
[0045] UUV plays an important role in the current ocean development, military operations and other fields. It can not only complete special tasks in complex marine environment, but also complete a series of actions such as autonomous navigation and obstacle avoidance without human intervention. Therefore, the research on UUV not only has important scientific significance, but also has urgent demand in the military field. With the increasing complexity of underwater operations, the previous single UUV-based underwater operations are difficult to meet the demand of work efficiency, capacity, range, time and other aspects. In recent years, the way of multi-UUV cooperative operation has begun to appear. Multi-UUV cooperative operation not only can perform tasks that single UUV cannot complete, but also greatly improves the ability of underwater operation and greatly reduces the working time of underwater operation, which has good application prospect. Multi-UUV cooperative operation often works underwater, and the communication means such as radio or laser has large signal attenuation in underwater transmission, which is more prominent in long-distance operation, so it cannot effectively communicate underwater. Acoustic communication uses acoustic signal as the only and effective transmission carrier in seawater medium, which is often used in underwater equipment.
[0046] At the same time, clock synchronization is very important in the scene of multi-UUV underwater cooperative operation, and is the basic condition for realizing cooperative operation. After submersion, due to the individual differences of UUV, the influence of temperature drift on UUV internal circuit and the inconsistency of UUV information processing speed and other factors, after a long time of underwater operation, the time of multiple UUVs is not synchronized. Due to the influence of the complex underwater information transmission environment and the serious underwater multipath effect, the bandwidth of underwater acoustic communication is very low, and the time synchronization between UUVs is difficult.
[0047] In the process of multi-UUV cooperative operation, the specific position and state of the UUV need to be worked by multiple UUVs in cooperation, so the clock synchronization of the system is very important. There are many factors that cause clock synchronization, such as sending time, access time, transmission time, propagation time, receiving time, and bearing time, which will affect the time synchronization of the networking system, which causes a large gap in the local clock time of each node in the networking system.
[0048] However, in the prior art, at least 4 messages are required for clock synchronization, and for underwater communication scenarios, network traffic still needs to be reduced.
[0049] The inventive concept of the present application will be further described below in conjunction with some specific embodiments.
[0050] In the following embodiments of the present application, a multimedia playback system applied in the technical implementation of the present application will be described.
[0051] Referring to Figure 1 , Figure 1 is a schematic diagram of the architecture of an underwater networking system provided by an exemplary embodiment. As Figure 1 shown, the underwater networking system can include multiple underwater devices. Among the multiple underwater devices, there are a first underwater device and at least one second underwater device. The first underwater device can be a master underwater device, and the second underwater device can be a slave underwater device. The slave underwater device needs to keep the local clock synchronized with the master underwater device. It can be understood that the underwater device can be a UUV. The UUV includes a water acoustic communication module, so that communication in the underwater environment can be realized through the water acoustic communication module.
[0052] It should be noted that the water acoustic communication module utilizes underwater acoustic communication technology. Underwater acoustic communication technology is to first convert text, voice, image and other information into electrical signals through an electrical transmitter, and then process the information digitally by an encoder. The transducer converts the electrical signal into an acoustic signal. The acoustic signal transmits the information to the receiving transducer through the water medium. At this time, the acoustic signal is converted into an electrical signal, and the digital information is deciphered by the decoder. The electrical receiver converts the information into sound, text and pictures.
[0053] Referring to Figure 2 , Figure 2 is a schematic diagram of the structure of the underwater device involved in the embodiment scheme of the present application.
[0054] As Figure 2As shown, the underwater device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM) such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0055] Those skilled in the art can understand that the structure shown in the above embodiment is not a limitation on the underwater device, and the underwater device can include more or fewer components than those shown, or combine certain components, or different component arrangements. Figure 2
[0056] As shown in the above embodiment, the underwater device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM) such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001. Figure 2
[0057] In the underwater device shown in the above embodiment, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user, and the underwater device calls a computer program stored in the memory 1005 through the processor 1001, and executes the clock synchronization method provided in the present application. Figure 2 Based on the above hardware structure but not limited to the above hardware structure, the present application provides a first embodiment of an underwater clock synchronization method. Referring to
[0058] Figure 3 , Figure 3 The flowchart of the underwater clock synchronization method of the present application is shown.
[0059] It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that shown.
[0060] In this embodiment, an underwater clock synchronization method includes:
[0061] Step S100, the second underwater device sends a delay request message.
[0062] The delay request message includes a first interval duration between a sending time of the second underwater device sending the delay request message and a set clock synchronization time.
[0063] Specifically, in the underwater networking system composed of multiple UUVs, all UUVs can be controlled by a ground control station or other ground equipment to perform clock synchronization operation before being launched. This clock synchronization operation is an initial clock synchronization operation, and optionally, without being launched, each UUV can receive satellite signals, so that the initial clock synchronization operation can be realized by clock synchronization through satellite signals such as GPS (Global Positioning System). After completing the initial clock synchronization, the underwater networking system performs master device competition, so that multiple UUVs select one UUV as a master UUV, i.e., the first underwater device, through the master device competition mechanism, and other UUVs automatically become slave UUVs, i.e., the second underwater device. Then the master UUV and the slave UUV are launched to start to cooperatively perform the assigned underwater task.
[0064] After being launched, the UUV cannot receive satellite signals and can only realize clock synchronization through underwater acoustic communication. After each slave UUV is launched, when a clock synchronization preset condition is met, the slave UUV can perform clock synchronization operation by using the underwater acoustic communication module. The clock synchronization preset condition can be that the current time reaches a preset time node of a preset clock synchronization period, or can be that the current time reaches a set duration from a set clock synchronization time, or before starting to perform a single specific task, or after performing a single specific task.
[0065] When performing clock synchronization, the slave UUV sends a delay request sync message. The sync message includes a message type, device identification information of the slave UUV, and a first interval duration between a sending time of the second underwater device sending the sync message and a set clock synchronization time.
[0066] The message type is used to mark that the message is a sync message, so that when other slave UUVs receive the sync message, the sync message will be discarded. The device identification information of the slave UUV can be the device ID information of the slave UUV, so that the master UUV knows which slave UUV sends the sync message.
[0067] The first interval length is a time difference between a sending time of the sync message sent by the slave UUV and a set clock synchronization time. The set clock synchronization time can be a time corresponding to an initial clock synchronization operation, a time corresponding to a last clock synchronization operation, or the like. Of course, since the initial clock synchronization operation is performed for all UUVs, the error between all slave UUVs is low, and the initial clock synchronization operation is performed through a satellite signal, the accuracy is high, and in order to avoid error accumulation, preferably, the set clock synchronization time can be a time corresponding to the initial clock synchronization operation.
[0068] It is worth mentioning that in the embodiment, the first interval length is a relative time, so compared with the absolute time used in the prior art, the first interval length in the sync message sent in the embodiment occupies a shorter message length, which is beneficial to the underwater low-bandwidth communication scenario.
[0069] Further, since the sync message is sent in the form of a data packet by the underwater acoustic communication module, the message does not need to define a packet start symbol, a packet end symbol, and a data check symbol, and the start symbol and the check of the data packet are completed by the underwater acoustic communication module, so the sync message only needs to consider the amount of information carried by the algorithm itself. As an embodiment, the first message format of the delay request message is: 1-bit message type, 7-bit device identification information, and 4-byte first interval length.
[0070] In an example, the Sync message format is as follows:
[0071] Among them, in the message type, 0 represents the sync message, and 1 represents the delay message.
[0072] Since the sync message is only sent to the master UUV, the device id is filled with 0.
[0073] t1 is specifically 0-4294967296 milliseconds, so after the UUV is underwater, t1 can record 1193 hours at most, which means that the UUV can continuously move underwater for 1193 hours, and during this period, the clock synchronization can be realized through the method provided in the embodiment. Of course, when the UUV floats to the surface, the clock synchronization can be realized through the satellite signal, at this time, the value of t1 is cleared.
[0074] As can be seen, in the embodiment, the Sync message is fixed to 5 bytes. Therefore, compared with the traditional 44-byte Sync message, in the embodiment, the Sync message removes unnecessary fields, greatly simplifies the Sync message, thereby improving the bandwidth utilization rate to adapt to the underwater communication scenario.
[0075] Step S200, the first underwater device monitors whether the delay request message sent by the second underwater device is received.
[0076] Step S300, when the first underwater device receives the delay request message, the current time is taken as the receiving time, and a second interval duration between the receiving time and the set clock synchronization time is obtained.
[0077] Step S400, in response to receiving the delay request message, the first underwater device sends a delay response message to the second underwater device.
[0078] The delay response message includes a second interval duration between the receiving time and the set clock synchronization time, and a third interval duration between the first underwater device receiving the delay request message and sending the delay response message. The receiving time is the time when the first underwater device receives the delay request message.
[0079] As shown, at T0, the master UUV and the slave UUV complete clock synchronization on the water surface. Then at T1 of the slave UUV clock, the slave UUV sends a sync message, which carries a first interval duration, i.e. T1-T0. At T2 of the master UUV, the master UUV receives the sync message, and at T3 of the master UUV, the master UUV sends a delay message. At this time, the delay message carries a second interval duration t2, i.e. t2=T2-T0, and a third interval duration t3, i.e. t3=T3-T2.
[0080] That is, after the first underwater device receives the Sync message, a delay response delay message is returned.
[0081] Similarly, since the delay message is sent by the underwater acoustic communication module in the form of a data packet, the delay message does not need to define a packet start symbol, a packet end symbol, and a data check symbol, etc. The start symbol and the check of the data packet are completed by the underwater acoustic communication module, and therefore the delay message also needs to consider the amount of information carried by the algorithm itself. As an embodiment, the second message format of the delay response message is: 1-bit message type, 7-bit device identification information, 4-byte second interval duration, and 1-byte third interval duration.
[0082] Specifically, the delay message format is as follows:
[0083]
[0084]
[0085] In the message type, 0 represents a sync message, and 1 represents a delay message.
[0086] Since the delay message is sent by the master UUV to the slave UUV, the device id is the number of the slave UUV. In an example, the device id takes a value in the range of 1-128, that is, there are at most 128 slave UUVs.
[0087] t2 is a second interval duration, and takes a value in the range of 0-4294967296 milliseconds, that is, a maximum of 1193 hours can be recorded, which means that the master UUV can continuously move underwater for 1193 hours, and time synchronization can be achieved through the clock synchronization method provided in the embodiment during the period. When the master UUV floats to the water surface, the satellite signal is used to achieve clock synchronization in the system, and the value of t2 is cleared.
[0088] t3 is a time difference between the time when the master UUV receives the sync message and the time when the delay message is sent. t3 takes a value in the range of 0-255 milliseconds. Generally, the time from receiving the sync message to sending the delay message usually does not exceed 100 milliseconds. Since the bandwidth of the underwater acoustic channel is low, in order to save bandwidth resources, 255 milliseconds can meet the general use in the case of compressing the data length as much as possible.
[0089] In this way, compared with the conventional 44-byte delay message, the delay message removes unnecessary fields, and the delay message is fixed to 6 bytes, so that network resources are greatly saved, and communication quality is improved.
[0090] As an example, when the first underwater device executes step 400, if the delay response message is not sent within a second preset time duration after the receiving time, the second message format is updated to obtain a new second message format; the new second message format includes a third interval duration of 2 bytes, and then the delay response message is sent by using the new second message format.
[0091] That is, in the embodiment, if the time difference from receiving the sync message to sending the delay message exceeds 255 milliseconds due to lower performance of the UUV, the t3 field of 1 byte in the delay message is set to 2 bytes, so that the total length of the new delay message is 7 bytes. Then, the delay response message is sent by using the new delay message of 7 bytes.
[0092] Therefore, the embodiment provides a special message format for UUVs with low performance. The special message format increases the length of the message by one byte compared with the general 6-byte message. However, compared with the traditional 44-byte delay message, the delay message greatly saves network resources and improves communication quality.
[0093] In step S500, when the second underwater device receives the delay reply message sent by the first underwater device, the second underwater device records a fourth interval length from the set clock synchronization time.
[0094] Specifically, due to the transmission delay, the second underwater device cannot receive the delay message immediately. In order to eliminate the influence of the transmission delay on the clock synchronization at the clock synchronization time, the fourth interval length t4 from the set clock synchronization time at which the delay message is received can be recorded. In an example, at T0, the master UUV and the slave UUV complete the clock synchronization on the water surface. Then, at T1 of the slave UUV clock, the slave UUV sends a sync message, which carries the first interval length, i.e., T1-T0. At T2 of the master UUV, the master UUV receives the sync message and sends a delay message at T3 of the master UUV. At this time, the delay message carries the second interval length t2, i.e., t2=T2-T0, and the third interval length, i.e., t3=T3-T2. At T4 of the slave UUV, the slave UUV receives the delay message, and records the time difference between T4 and T0, i.e., t4=T4-T0.
[0095] As an example, in step S500, when the second underwater device receives the delay reply message, the second underwater device extracts the device identification information of the delay reply message.
[0096] When the device identification information matches the second underwater device, the second underwater device records the fourth interval length from the set clock synchronization time.
[0097] That is, when the slave UUV receives the delay message broadcast, the slave UUV with a matched device ID processes the delay message through the device ID field in the delay message, and the other slave UUVs discard the message, so as to avoid confusion of the clock synchronization among the slave UUVs.
[0098] It can be understood that the underwater environment is complex, and unexpected situations such as disconnection of the master UUV and the slave UUV or loss of the master UUV can occur. As an embodiment, if the second underwater device does not receive the delay response message within a preset time period after the sending time, the second underwater device records the number of unanswered times and returns to step S100.
[0099] When the second underwater device receives the delay response message, the second underwater device clears the number of times and performs step S500.
[0100] When the number of times is greater than or equal to a preset threshold, the second underwater device stops sending the delay request message and sends alarm information to the ground device.
[0101] Specifically, the slave UUV sends a sync message, and if a delay message containing the ID of the device is not received within a preset time period (such as 30 seconds), the slave UUV records the number of unanswered times as 1, and the slave UUV re-sends the sync message. If a delay message containing the ID of the device is received, the number of unanswered times is cleared. If the preset threshold is 10 times, the corresponding delay message is not received after repeated sending for 10 times, the slave UUV stops sending the sync message, and reports an alarm to the UUV ground console and other ground devices.
[0102] In this way, the embodiment provides an alarm mechanism to timely discover abnormal situations in the networking and alarm to the ground workbench and the like to remind the staff to solve the problem in time.
[0103] Step S600, the second underwater device determines the clock error information between the first underwater device and the second underwater device according to the first interval time, the second interval time, the third interval time, and the fourth interval time.
[0104] Specifically, the clock error information between the first underwater device and the second underwater device is determined according to the first interval time, the second interval time, the third interval time, the fourth interval time, and a first formula.
[0105] The first formula is:
[0106]
[0107] Wherein, offest is the clock error information, t1 is the first interval time, t2 is the second interval time, t3 is the third interval time, and t4 is the fourth interval time.
[0108] It can be understood that, for underwater communication between the master UUV and the slave UUV, in the message sending process, the clock error information offset and the message transmission delay delay between the master UUV and the slave UUV satisfy the following equation:
[0109]
[0110] Solving the above equation, we get
[0111]
[0112] Step S700, according to the clock error information, the second underwater device updates the local clock, so that the local clock and the clock of the first underwater device are synchronized.
[0113] The slave UUV adjusts its own time to be consistent with the master UUV, and the slave UUV's time t=t+offest.
[0114] For each slave UUV in the network, the above steps can be performed to keep its own time consistent with the master UUV, that is, to keep the clock synchronized.
[0115] Therefore, the embodiment improves the existing clock synchronization method with 4-step message sending steps to a clock synchronization method with 2-step message sending steps, thereby reducing the network communication amount of underwater acoustic communication, facilitating the communication cooperation of the underwater networking system.
[0116] In addition, the embodiment of the application also provides a computer readable storage medium, and the storage medium stores a clock synchronization program. When the clock synchronization program is executed by a processor, the steps of the underwater clock synchronization method described above are implemented. Therefore, this will not be described again. In addition, the beneficial effects of using the same method will not be described again. For technical details not disclosed in the computer readable storage medium embodiment of the application, please refer to the description of the method embodiment of the application. For example, the program instructions can be deployed to execute on one computing device, or on multiple computing devices located in one place, or on multiple computing devices distributed in multiple places and interconnected through a communication network.
[0117] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by a computer program instructing related hardware. The above-mentioned program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments of the method. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0118] It should be noted that the apparatus embodiments described above are only illustrative, and units described as separate components can or can not be physically separate, and components shown as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to actual needs. In addition, the connection relationship between the modules in the apparatus embodiments provided in the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.
[0119] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary general hardware, and of course can also be realized by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. Generally, functions completed by computer programs can be easily realized by corresponding hardware, and the specific hardware structure for realizing the same function can also be various, such as analog circuit, digital circuit or special circuit, etc. However, for the present application, software program implementation is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of software products, which are stored in readable storage media, such as computer floppy disks, U disks, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic or optical disks, etc., including a plurality of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods of various embodiments of the present application.
[0120] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method of underwater clock synchronization, characterized by, The method is used for a second underwater device, and comprises the following steps: sending a delay request message; wherein the delay request message comprises a first interval time length between a sending time point of the second underwater device sending the delay request message and a set clock synchronization time point; the set clock synchronization time point is a time point corresponding to an initial clock synchronization operation; when receiving a delay response message sent by the first underwater device, recording a fourth interval time length between a current time point and the set clock synchronization time point; wherein the delay response message comprises a second interval time length between a receiving time point and the set clock synchronization time point, and a third interval time length between the first underwater device receiving the delay request message and sending the delay response message; the receiving time point is a time point at which the first underwater device receives the delay request message; determining clock error information between the first underwater device and the second underwater device according to the first interval time length, the second interval time length, the third interval time length and the fourth interval time length; updating a local clock according to the clock error information, so as to synchronize the local clock with a clock of the first underwater device.
2. The underwater clock synchronization method of claim 1, wherein, The determining of the clock error information between the first underwater device and the second underwater device according to the first interval time length, the second interval time length, the third interval time length and the fourth interval time length comprises: determining the clock error information between the first underwater device and the second underwater device according to the first interval time length, the second interval time length, the third interval time length, the fourth interval time length and a first formula; the first formula is: wherein offset is the clock error information, t1 is the first interval time length, t2 is the second interval time length, t3 is the third interval time length, and t4 is the fourth interval time length.
3. The underwater clock synchronization method of claim 1, wherein, The delay request message and the delay response message both further comprise device identification information; the recording of the fourth interval time length between the current time point and the set clock synchronization time point when the delay response message sent by the first underwater device is received comprises: when the delay response message is received, extracting the device identification information of the delay response message; when the device identification information matches the second underwater device, recording the fourth interval time length between the current time point and the set clock synchronization time point.
4. The underwater clock synchronization method of claim 1, wherein, The first message format of the delay request message is: 1-bit message type, 7-bit device identification information and 4-byte first interval time length.
5. The underwater clock synchronization method according to any one of claims 1 to 4, characterized in that, after the delay request message is sent, the method further comprises the following steps: if the delay response message is not received within a preset time length after the sending time point, recording a number of unresponded times, and returning to execute the sending of the delay request message; when the delay response message is received, the number of times is cleared; when the number of times is greater than or equal to a preset threshold, stopping sending the delay request message, and sending alarm information to a ground device.
6. A method of underwater clock synchronization, characterized by, the method is used for a first underwater device, and comprises the following steps: monitoring whether a delay request message sent by a second underwater device is received; wherein the delay request message comprises a first interval time length between a sending time point at which the second underwater device sends the delay request message and a set clock synchronization time point; the set clock synchronization time point is a time point corresponding to an initial clock synchronization operation; when the delay request message is received, taking a current time point as a receiving time point, and obtaining a second interval time length between the receiving time point and the set clock synchronization time point; sending a delay response message to the second underwater device, so that the second underwater device records a fourth interval time length between a time point at which the delay response message is received and the set clock synchronization time point, and determines clock error information between the first underwater device and the second underwater device according to the first interval time length, the second interval time length, the third interval time length and the fourth interval time length, and updates a local clock according to the clock error information, so that the local clock is synchronized with a clock of the first underwater device; wherein the second interval time length is a time length between the time point at which the first underwater device receives the delay request message and the set clock synchronization time point, and the third interval time length is a time length between the time point at which the delay request message is received and the time point at which the delay response message is sent.
7. The underwater clock synchronization method of claim 6, wherein, a second message format of the delay response message is: 1-bit message type, 7-bit device identification information, 4-byte second interval time length and 1-byte third interval time length.
8. The underwater clock synchronization method of claim 7, wherein, the sending of the delay response message to the second underwater device comprises: if the delay response message is not sent within a second preset time length after the receiving time point, the second message format is updated to obtain a new second message format; the new second message format comprises 2-byte third interval time length; the delay response message is sent by using the new second message format.
9. An underwater networking system, characterized by comprises: a first underwater device, comprising: a processor, a memory and a computer program stored in the memory, the computer program, when executed by the processor, implements steps of the underwater clock synchronization method according to any one of claims 1-5; and at least one second underwater device, the second underwater device and the first underwater device are connected through underwater acoustic communication; the second underwater device comprises: a processor, a memory and a computer program stored in the memory, the computer program, when executed by the processor, implements steps of the underwater clock synchronization method according to any one of claims 6-8.
10. A computer-readable storage medium, characterized in that, the computer readable storage medium stores a computer program, the computer program, when executed by the processor, implements the underwater clock synchronization method according to any one of claims 1-8.
Citation Information
Patent Citations
Underwater sensor time synchronization method
CN108668356A