Time Synchronization Method, Device, Electronic Device and Storage Medium Based on Underwater Acoustic Communication
Through the timing method based on water acoustic communication, through water acoustic information interaction and pulse signal timestamp marking, the existing underwater timing method is solved for the high cost of long-distance transmission and high cost, and efficient clock synchronization and long-distance signal transmission are achieved.
Patent Information
- Application Number
- CN202510127768.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-02-05
AI Technical Summary
The existing underwater timing method has poor penetration capabilities underwater, cannot meet the long-distance transmission needs, and has high hardware costs.
The time-saving method based on water acoustic communication is adopted to generate and mark the timestamp of the pulse signal through the interaction of water acoustic information between the slave device and the master device to calculate the master-slave time difference and update the local time.
The clock consistency between the master and slave devices is achieved, the clock signal synchronization efficiency is improved, and the signal transmission distance is expanded through water acoustic communication.
Smart Images

Figure CN119582972B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of underwater acoustic communication, and particularly to a timing method, device, electronic device, and storage medium based on underwater acoustic communication. Background Art
[0002] Underwater timing, as an important part of the Positioning, Navigation, and Timing (PNT) technology, is widely used in many fields such as marine resource exploration and marine environment monitoring, and is also a necessary prerequisite for underwater operations.
[0003] In the prior art, underwater timing usually obtains a high-precision time reference by adopting different timing methods according to different application scenarios. For example, it is realized through timing methods such as blue-green laser timing, fiber optic timing, and low-frequency radio timing; among them, blue-green laser timing refers to a laser communication method using blue-green laser as the carrier.
[0004] However, for the above-mentioned underwater timing methods, blue-green laser timing and low-frequency radio timing have poor penetration ability underwater and are only suitable for short-distance underwater wireless timing, unable to meet the long-distance transmission requirements; fiber optic timing depends on the underwater laid optical cable to achieve, with poor transmission convenience and high hardware cost. Summary of the Invention
[0005] The present invention provides a timing method, device, electronic device, and storage medium based on underwater acoustic communication to solve the problems of short transmission distance and low transmission efficiency of underwater clock signals.
[0006] According to one aspect of the present invention, there is provided a timing method based on underwater acoustic communication, applied to a slave device, including:
[0007] Generating multi-byte first underwater acoustic information according to the local time, and sending the first underwater acoustic information to the master device, so that the master device feeds back second underwater acoustic information and first timing information based on the first underwater acoustic information;
[0008] Generating a first pulse signal according to the first underwater acoustic information, and marking a first timestamp at the edge of the first pulse signal; wherein the number of first pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0009] Generating a second pulse signal according to the second underwater acoustic information, and marking a second timestamp at the edge of the second pulse signal; wherein the number of second pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0010] Calculate and obtain the first master-slave time difference based on each of the first timestamps, each of the second timestamps, and the first timing information, and update the local time according to the first master-slave time difference.
[0011] The generating of the first pulse signal according to the first underwater acoustic information includes: generating the first pulse signal based on a preset pulse rule according to the first underwater acoustic information; the calculating and obtaining of the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information includes: determining whether the second pulse signal conforms to the preset pulse rule; if it is determined that the second pulse signal conforms to the preset pulse rule, calculating and obtaining the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information; if it is determined that the second pulse signal does not conform to the preset pulse rule, discard the first timing information and do not update the local time.
[0012] After it is determined that the second pulse signal conforms to the preset pulse rule, it further includes: judging whether the first timing information is valid according to the timing result identifier of the first timing information; if it is determined that the first timing information is invalid, discard the first timing information and do not update the local time; if it is determined that the first timing information is valid, calculate and obtain the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information.
[0013] The updating of the local time according to the first master-slave time difference includes: continuing to generate multi-byte first underwater acoustic information according to the local time, and sending the first underwater acoustic information to the master device so that the master device feeds back the second underwater acoustic information and the first timing information again based on the first underwater acoustic information; continuing to generate the first pulse signal according to the first underwater acoustic information, marking the first timestamp at the edge of the first pulse signal, and generating the second pulse signal according to the second underwater acoustic information, and marking the second timestamp at the edge of the second pulse signal; calculating and obtaining the second master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information; judging whether the difference between the first master-slave time difference and the second master-slave time difference is less than or equal to a preset time difference threshold; if it is determined that it is less than or equal to the preset time difference threshold, update the local time according to the first master-slave time difference and the second master-slave time difference.
[0014] After determining whether the difference between the first master-slave time difference and the second master-slave time difference is less than or equal to a preset time difference threshold, it further includes: if it is determined that the difference is greater than the preset time difference threshold, generating multi-byte third underwater acoustic information according to the local time, and sending the third underwater acoustic information to the master device, so that the master device feeds back fourth underwater acoustic information and second timing information based on the third underwater acoustic information; wherein, the number of bytes of the third underwater acoustic information is greater than the number of bytes of the first underwater acoustic information; generating a third pulse signal according to the third underwater acoustic information, and marking a third timestamp at the edge of the third pulse signal; wherein, the number of third pulse signals is equal to the number of bytes of the third underwater acoustic information; generating a fourth pulse signal according to the fourth underwater acoustic information, and marking a fourth timestamp at the edge of the fourth pulse signal; wherein, the number of fourth pulse signals is equal to the number of bytes of the third underwater acoustic information; calculating and obtaining a third master-slave time difference according to each of the third timestamps, each of the fourth timestamps and the second timing information, and updating the local time according to the first master-slave time difference, the second master-slave time difference and the third master-slave time difference.
[0015] According to another aspect of the present invention, there is provided a timing method based on underwater acoustic communication, which is applied to a master device and includes:
[0016] Generating a fifth pulse signal according to multi-byte first underwater acoustic information sent by a slave device, and marking a fifth timestamp at the edge of the fifth pulse signal; wherein, the number of fifth pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0017] Generating multi-byte second underwater acoustic information according to the local time, and sending the second underwater acoustic information to the slave device, so that the slave device generates a second pulse signal based on the second underwater acoustic information;
[0018] Generating a sixth pulse signal according to the second underwater acoustic information, and marking a sixth timestamp at the edge of the sixth pulse signal; wherein, the number of sixth pulse signals is equal to the number of bytes of the second underwater acoustic information;
[0019] Calculating and obtaining first timing information according to each of the fifth timestamps and each of the sixth timestamps, and sending the first timing information to the slave device, so that the slave device updates the local time based on the first timing information.
[0020] According to another aspect of the present invention, there is provided a timing device based on underwater acoustic communication, which is applied to a slave device and includes:
[0021] A first information sending module, configured to generate multi-byte first underwater acoustic information according to the local time, and send the first underwater acoustic information to the master device, so that the master device feeds back second underwater acoustic information and first timing information based on the first underwater acoustic information;
[0022] The first pulse generation module is configured to generate a first pulse signal according to the first underwater acoustic information and mark a first timestamp at the edge of the first pulse signal; wherein, the number of the first pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0023] The first information receiving module is configured to generate a second pulse signal according to the second underwater acoustic information and mark a second timestamp at the edge of the second pulse signal; wherein, the number of the second pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0024] The timing information receiving module is configured to calculate and obtain a first master-slave time difference according to each of the first timestamps, each of the second timestamps and the first timing information, and update the local time according to the first master-slave time difference.
[0025] According to another aspect of the present invention, there is provided a timing device based on underwater acoustic communication, which is applied to a master device and includes:
[0026] The second information receiving module is configured to generate a fifth pulse signal according to the multi-byte first underwater acoustic information sent by the slave device and mark a fifth timestamp at the edge of the fifth pulse signal; wherein, the number of the fifth pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0027] The second information sending module is configured to generate multi-byte second underwater acoustic information according to the local time and send the second underwater acoustic information to the slave device, so that the slave device generates a second pulse signal based on the second underwater acoustic information;
[0028] The second pulse generation module is configured to generate a sixth pulse signal according to the second underwater acoustic information and mark a sixth timestamp at the edge of the sixth pulse signal; wherein, the number of the sixth pulse signals is equal to the number of bytes of the second underwater acoustic information;
[0029] The timing information sending module is configured to calculate and obtain the first timing information according to each of the fifth timestamps and each of the sixth timestamps, and send the first timing information to the slave device, so that the slave device updates the local time based on the first timing information.
[0030] According to another aspect of the present invention, there is provided an electronic device, and the electronic device includes:
[0031] At least one processor; and
[0032] A memory communicatively connected to the at least one processor; wherein,
[0033] The memory stores a computer program executable by the at least one processor. When the computer program is executed by the at least one processor, the at least one processor is enabled to execute the time synchronization method based on underwater acoustic communication according to Embodiment 1 of the present invention, or execute the time synchronization method based on underwater acoustic communication according to Embodiment 2 of the present invention.
[0034] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to execute the time synchronization method based on underwater acoustic communication according to Embodiment 1 of the present invention, or execute the time synchronization method based on underwater acoustic communication according to Embodiment 2 of the present invention.
[0035] According to another aspect of the present invention, there is provided a computer program product including a computer program which, when executed by a processor, implements the time synchronization method based on underwater acoustic communication according to Embodiment 1 of the present invention, or implements the time synchronization method based on underwater acoustic communication according to Embodiment 2 of the present invention.
[0036] In the technical solution of the embodiment of the present invention, a slave device generates multi-byte first underwater acoustic information according to local time and sends the first underwater acoustic information to the master device; the slave device generates a first pulse signal according to the first underwater acoustic information and marks a first timestamp at the edge of the first pulse signal; the slave device generates a second pulse signal according to the second underwater acoustic information fed back by the master device and marks a second timestamp at the edge of the second pulse signal; the slave device updates local time according to the first timestamp, the second timestamp and the first time synchronization information fed back by the master device. Thereby, not only the clock consistency between the master device and the slave device is achieved, the clock signal synchronization efficiency is improved, but also based on the underwater acoustic communication transmission mode, while realizing wireless signal transmission, the signal transmission distance is greatly extended.
[0037] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Description of the Drawings
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0039] Figure 1 is a flowchart of a time synchronization method based on underwater acoustic communication according to Embodiment 1 of the present invention;
[0040] Figure 2 It is a schematic structural diagram of a slave device provided in Embodiment 1 of the present invention;
[0041] Figure 3 It is a schematic structural diagram of a master device provided in Embodiment 1 of the present invention;
[0042] Figure 4 It is a flowchart of another timing method based on underwater acoustic communication provided in Embodiment 2 of the present invention;
[0043] Figure 5 It is a schematic diagram of the interaction process of a timing method based on underwater acoustic communication provided in Embodiment 3 of the present invention;
[0044] Figure 6 It is a schematic structural diagram of a timing device based on underwater acoustic communication provided in Embodiment 4 of the present invention;
[0045] Figure 7 It is a schematic structural diagram of another timing device based on underwater acoustic communication provided in Embodiment 5 of the present invention;
[0046] Figure 8 It is a schematic structural diagram of an electronic device for implementing the timing method based on underwater acoustic communication in the embodiments of the present invention. Detailed implementation manners
[0047] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to 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 the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0049] Embodiment 1
[0050] Figure 1 The figure is a flowchart of a time synchronization method based on underwater acoustic communication provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation where clock signal transmission is achieved according to the underwater acoustic information interaction between a slave device and a master device. This method can be executed by the time synchronization device based on underwater acoustic communication in Embodiment 4 of the present invention. The time synchronization device based on underwater acoustic communication can be implemented in the form of hardware and / or software, and can be configured in the slave device. The slave device is specifically an electronic device applied underwater, such as Figure 1 shown, and the method includes:
[0051] S101. Generate multi-byte first underwater acoustic information according to the local time, and send the first underwater acoustic information to the master device, so that the master device feeds back second underwater acoustic information and first time synchronization information based on the first underwater acoustic information.
[0052] As Figure 2 shown, the slave device may specifically include a first time synchronization unit 110, a first control unit 120, and a first communication unit 130. After generating a local time synchronization signal, the first time synchronization unit 110 sends the local time to the first control unit 120. After encoding the identified local time by the first control unit 120 (for example, convolutional code and error correction code), the encoded information (i.e., the first encoded information) is sent to the first communication unit 130. Among them, the first encoded information is multi-byte transmission information, and the specific number of bytes can be pre-configured.
[0053] The first communication unit 130 converts the first encoded information into a data format suitable for underwater transmission, thereby generating the first underwater acoustic information. For example, through modulation methods such as frequency shift keying (FSK) and phase shift keying (PSK), the digital signal is converted into an analog signal to meet the data transmission requirements of underwater acoustic communication. Among them, the number of bytes of the first underwater acoustic information is obviously the same as that of the first encoded information. After receiving the first underwater acoustic information sent by the first communication unit 130, the master device will successively send the second underwater acoustic information and the first time synchronization information to the slave device.
[0054] S102. Generate a first pulse signal according to the first underwater acoustic information, and mark a first timestamp at the edge of the first pulse signal; where the number of first pulse signals is equal to the number of bytes of the first underwater acoustic information.
[0055] When the first communication unit 130 sends the first underwater acoustic information, for each byte sent, it will feedback a pulse signal (i.e., the first pulse signal) to the first control unit 120; the first control unit 120 marks the timestamp information (i.e., the first timestamp) at the trigger edge (rising edge or falling edge) of each first pulse signal. The first timestamp represents the trigger moment of the first pulse signal, and actually also reflects the sending moments of the respective bytes of the first underwater acoustic information.
[0056] As Figure 3 shown, the master device may specifically include a second timing unit 210, a second control unit 220, and a second communication unit 230; after the second communication unit 230 receives the multi-byte first underwater acoustic information sent by the slave device, for each byte received, it sends a pulse signal (i.e., the fifth pulse signal) to the second control unit 220; the second control unit 220 marks the timestamp information (i.e., the fifth timestamp) at the trigger edge (rising edge or falling edge) of each fifth pulse signal. The fifth timestamp represents the trigger moment of the fifth pulse signal, and actually also reflects the receiving moments of the respective bytes of the first underwater acoustic information.
[0057] After the second communication unit 230 completely receives the first underwater acoustic information, it sends the packet information to the second control unit 220; after the second control unit 220 obtains the first underwater acoustic information, it encodes the local time in the second timing unit 210, and then sends the encoded information (i.e., the second encoded information) to the second communication unit 230; the second communication unit 230 converts the second encoded information into a data format suitable for underwater transmission, thereby generating the second underwater acoustic information; wherein, the second underwater acoustic information is also a multi-byte transmission information, and the specific number of bytes is the same as that of the first underwater acoustic information.
[0058] When the second communication unit 230 sends the second underwater acoustic information, for each byte sent, it will feedback a pulse signal (i.e., the sixth pulse signal) to the second control unit 220; the second control unit 220 marks the timestamp information (i.e., the sixth timestamp) at the trigger edge (rising edge or falling edge) of each sixth pulse signal. The sixth timestamp represents the trigger moment of the sixth pulse signal, and actually also reflects the sending moments of the respective bytes of the second underwater acoustic information.
[0059] S103. Generate a second pulse signal according to the second underwater acoustic information, and mark a second timestamp at the edge of the second pulse signal; wherein, the number of second pulse signals is equal to the number of bytes of the first underwater acoustic information.
[0060] After the first communication unit 130 receives the multi-byte second underwater acoustic information sent by the slave device, it sends a pulse signal (i.e., the second pulse signal) to the first control unit 120 for each received byte; the first control unit 120 marks the timestamp information (i.e., the second timestamp) at the trigger edge (rising edge or falling edge) of each second pulse signal. The second timestamp represents the trigger moment of the second pulse signal and actually reflects the reception moments of the respective bytes of the second underwater acoustic information.
[0061] In addition, the master device sums each fifth timestamp and the corresponding sixth timestamp according to the trigger order of the pulse signals, and then continues to accumulate each summation result. The quotient of the accumulated result and the number of bytes of the first underwater acoustic information is the timing information (i.e., the first timing information); specifically, as shown in Formula 1:
[0062] (Formula 1);
[0063] Where, represents the first timing information; and are the fifth timestamp and the sixth timestamp respectively; represents the number of the fifth timestamp or the sixth timestamp, and also represents the number of bytes of the first underwater acoustic information or the second underwater acoustic information; represents the numbers of the fifth timestamp and the sixth timestamp.
[0064] S104. Calculate and obtain the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information, and update the local time according to the first master-slave time difference.
[0065] The slave device sums each first timestamp and the corresponding second timestamp according to the trigger order of the pulse signals, and then continues to accumulate each summation result. The quotient of the accumulated result and the number of bytes of the first underwater acoustic information is the local timing information; specifically, as shown in Formula 2:
[0066] (Formula 2);
[0067] Where, represents the local timing information; and represent the first timestamp and the second timestamp respectively; represents the number of the first timestamp or the second timestamp, and also represents the number of bytes of the first underwater acoustic information or the second underwater acoustic information; represents the numbers of the first timestamp and the second timestamp.
[0068] According to the first timing information and the local timing information, the first master-slave time difference can be calculated and obtained. The first master-slave time difference reflects the time difference between the master device and the slave device; as shown in Formula 3:
[0069] (Formula 3);
[0070] wherein, represents the first master-slave time difference; thus, the first master-slave time difference can be used as the time difference between the local time and the master device time, and further the local time can be updated.
[0071] Specifically, the first timing unit 110, the first control unit 120, and the first communication unit 130 inside the slave device use the system clock of the same frequency as the internal clock source to make the clocks of each functional unit consistent; the second timing unit 210, the second control unit 220, and the second communication unit 230 inside the master device also use the system clock of the same frequency as the internal clock source; the transmission of the first underwater acoustic information and the second underwater acoustic information between the master device and the slave device are both completed based on the underwater acoustic communication technology.
[0072] Optionally, in the embodiment of the present invention, the generating the first pulse signal according to the first underwater acoustic information includes: generating the first pulse signal according to the first underwater acoustic information based on a preset pulse rule; the calculating and obtaining the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information includes: determining whether the second pulse signal conforms to the preset pulse rule; if it is determined that the second pulse signal conforms to the preset pulse rule, calculating and obtaining the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information; if it is determined that the second pulse signal does not conform to the preset pulse rule, discarding the first timing information and not updating the local time.
[0073] Specifically, when the first communication unit 130 sends the first underwater acoustic information and triggers the first pulse signal, each first pulse signal is sent according to the preset pulse rule; for example, the preset pulse rule can be defined as follows: the first pulse signal is used as the pulse signal frame header, and its pulse width length is N microseconds; the second pulse signal represents the number of pulse signals, and its pulse width length is M microseconds; the last pulse signal represents the pulse signal frame tail, and its pulse width length is 2N microseconds; the pulse width lengths of the remaining pulse signals are all 1 microsecond, and N is greater than M in the above values. Thus, the transmission pulses generated when sending the underwater acoustic information are all generated according to the preset pulse rule.
[0074] Similarly, when the slave device receives the second underwater acoustic information and triggers the second pulse signal at the same time, it determines whether each received second pulse signal conforms to the above-mentioned preset pulse rule; if the second pulse signal conforms to the preset pulse rule, it means that the slave device generates pulse signals according to the same rule during the process of sending the first underwater acoustic information and receiving the second underwater acoustic information, which not only indicates that no transmission failure occurs during the signal transmission process, but also facilitates matching the first pulse signal and the second pulse signal according to the preset pulse rule, thereby completing the validity verification of the pulse signal.
[0075] Based on this, the first master-slave time difference can be calculated and obtained according to the first timestamp, the second timestamp, and the first timing information; if it is determined that the second pulse signal does not conform to the preset pulse rule, it means that there is a transmission failure during the signal transmission process, and each second pulse signal cannot establish a matching relationship with the corresponding first pulse signal, that is, the first timestamp and the second timestamp are considered invalid. Therefore, the first timing information is discarded, and the local time is not updated. The slave device continues to send subsequent underwater acoustic information to complete the local time update again through the subsequent underwater acoustic information. Thus, according to the validity verification result of the pulse signal of the slave device, the effectiveness of the first timestamp and the second timestamp is ensured, and the accuracy of the calculation result of the first master-slave time difference is improved.
[0076] Optionally, in the embodiment of the present invention, after determining that the second pulse signal conforms to the preset pulse rule, it further includes: judging whether the first timing information is valid according to the timing result identifier of the first timing information; if it is determined that the first timing information is invalid, discard the first timing information and do not update the local time; if it is determined that the first timing information is valid, calculate and obtain the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first timing information.
[0077] Specifically, when the master device receives the first underwater acoustic information and triggers the fifth pulse signal at the same time, it also determines whether each received fifth pulse signal conforms to the above-mentioned preset pulse rule. When it sends the second underwater acoustic information and triggers the sixth pulse signal at the same time, it also generates each sixth pulse signal according to the preset pulse rule; if the fifth pulse signal conforms to the preset pulse rule, it means that the master device generates pulse signals according to the same rule during the process of sending the second underwater acoustic information and receiving the first underwater acoustic information, which not only indicates that no transmission failure occurs during the signal transmission process, but also facilitates matching the fifth pulse signal and the sixth pulse signal according to the preset pulse rule, thereby completing the validity verification of the pulse signal.
[0078] If the master device passes the validity check of the pulse signal, that is, configures the timing result flag in the first timing information as valid (for example, configures it as "1"), it indicates that the first timing information sent this time is valid; if the master device fails the validity check of the pulse signal, that is, configures the timing result flag in the first timing information as invalid (for example, configures it as "0"), it indicates that the first timing information sent this time is invalid; if the slave device determines that the first timing information is invalid, it abandons the first timing information and does not update the local time; if the slave device determines that the first timing information is valid, based on this, it can calculate and obtain the first master-slave time difference according to the first timestamp, the second timestamp and the first timing information. Thus, according to the validity check result of the master device's pulse signal, the validity of the first timing information is ensured, and the accuracy of the calculated result of the first master-slave time difference is improved.
[0079] Optionally, in the embodiment of the present invention, the updating the local time according to the first master-slave time difference includes: continuing to generate multi-byte first underwater acoustic information according to the local time, and sending the first underwater acoustic information to the master device, so that the master device feeds back second underwater acoustic information and first timing information again based on the first underwater acoustic information; continuing to generate a first pulse signal according to the first underwater acoustic information, marking a first timestamp at the edge of the first pulse signal, and generating a second pulse signal according to the second underwater acoustic information, and marking a second timestamp at the edge of the second pulse signal; calculating and obtaining a second master-slave time difference according to each of the first timestamps, each of the second timestamps and the first timing information; determining whether the difference between the first master-slave time difference and the second master-slave time difference is less than or equal to a preset time difference threshold; if it is determined that it is less than or equal to the preset time difference threshold, updating the local time according to the first master-slave time difference and the second master-slave time difference.
[0080] Specifically, after obtaining the first master-slave time difference, the first underwater acoustic information can be continuously sent as described in the above technical solution, and after the above interaction process, the master-slave time difference (i.e., the second master-slave time difference) sent by the master device is obtained again; if the difference between the first master-slave time difference and the second master-slave time difference is small, that is, the two values are close to each other, it indicates that the values of the obtained first master-slave time difference and the second master-slave time difference are both relatively accurate. At this time, the average value of the two can be used as the actual master-slave time difference, and the local time is updated based on the actual master-slave time difference, so as to improve the accuracy of the local time update result and ensure the clock consistency between the slave device and the master device.
[0081] Optionally, in the embodiments of the present invention, after determining whether the difference between the first master-slave time difference and the second master-slave time difference is less than or equal to a preset time difference threshold, the following steps are further included: If it is determined that the difference is greater than the preset time difference threshold, multi-byte third underwater acoustic information is generated according to the local time, and the third underwater acoustic information is sent to the master device, so that the master device feeds back fourth underwater acoustic information and second timing information based on the third underwater acoustic information; wherein, the number of bytes of the third underwater acoustic information is greater than the number of bytes of the first underwater acoustic information; a third pulse signal is generated according to the third underwater acoustic information, and a third timestamp is marked at the edge of the third pulse signal; wherein, the number of third pulse signals is equal to the number of bytes of the third underwater acoustic information; a fourth pulse signal is generated according to the fourth underwater acoustic information, and a fourth timestamp is marked at the edge of the fourth pulse signal; wherein, the number of fourth pulse signals is equal to the number of bytes of the third underwater acoustic information; the third master-slave time difference is calculated and obtained according to each of the third timestamps, each of the fourth timestamps and the second timing information, and the local time is updated according to the first master-slave time difference, the second master-slave time difference and the third master-slave time difference.
[0082] Specifically, if the difference between the first master-slave time difference and the second master-slave time difference is large, that is, their values are not close to each other, it means that at least one of the obtained first master-slave time difference and second master-slave time difference has a large numerical error. At this time, the number of bytes of the underwater acoustic information is increased. Similarly, as described in the above technical solution, the third underwater acoustic information is sent again, and a third pulse signal is generated. Obviously, the number of bytes of the third underwater acoustic information is greater than the number of bytes of the first underwater acoustic information; then the fourth underwater acoustic information is received, and a fourth pulse signal is generated. Finally, the third master-slave time difference is calculated and obtained according to the obtained second timing information.
[0083] Thus, the third master-slave time difference can be directly used as the actual master-slave time difference, or the weighted result of the first master-slave time difference, the second master-slave time difference and the third master-slave time difference can be used as the actual master-slave time difference. Moreover, the weight of the third master-slave time difference is greater than the weights of the first master-slave time difference and the second master-slave time difference. Among the first master-slave time difference and the second master-slave time difference, the one with a value close to the third master-slave time difference has a larger weight value, and the other has a smaller weight value. Furthermore, the local time is updated based on the actual master-slave time difference, thereby improving the accuracy of the local time update result and ensuring the clock consistency between the slave device and the master device.
[0084] In the technical solution of the embodiment of the present invention, a slave device generates multi-byte first underwater acoustic information according to local time and sends the first underwater acoustic information to a master device; the slave device generates a first pulse signal according to the first underwater acoustic information and marks a first timestamp at the edge of the first pulse signal; the slave device generates a second pulse signal according to the second underwater acoustic information fed back by the master device and marks a second timestamp at the edge of the second pulse signal; the slave device updates the local time according to the first timestamp, the second timestamp, and the first timing information fed back by the master device. Thus, not only the clock consistency between the master device and the slave device is achieved, the clock signal synchronization efficiency is improved, but also based on the underwater acoustic communication transmission mode, while realizing wireless signal transmission, the signal transmission distance is greatly extended.
[0085] Embodiment 2
[0086] Figure 4 The flowchart of a timing method based on underwater acoustic communication provided by Embodiment 2 of the present invention. This embodiment is applicable to the situation where clock signal transmission is realized according to the underwater acoustic information interaction between a slave device and a master device. This method can be executed by the timing device based on underwater acoustic communication in Embodiment 5 of the present invention. The timing device based on underwater acoustic communication can be implemented in the form of hardware and / or software. The timing device based on underwater acoustic communication can be configured in the master device. The master device is specifically an electronic device applied underwater, such as Figure 4 As shown, the method includes:
[0087] S201. Generate a fifth pulse signal according to the multi-byte first underwater acoustic information sent by the slave device, and mark a fifth timestamp at the edge of the fifth pulse signal; wherein, the number of the fifth pulse signals is equal to the number of bytes of the first underwater acoustic information.
[0088] S202. Generate multi-byte second underwater acoustic information according to local time and send the second underwater acoustic information to the slave device, so that the slave device generates a second pulse signal based on the second underwater acoustic information.
[0089] S203. Generate a sixth pulse signal according to the second underwater acoustic information, and mark a sixth timestamp at the edge of the sixth pulse signal; wherein, the number of the sixth pulse signals is equal to the number of bytes of the second underwater acoustic information.
[0090] S204. Calculate and obtain first timing information according to each of the fifth timestamps and each of the sixth timestamps, and send the first timing information to the slave device, so that the slave device updates the local time based on the first timing information.
[0091] In the technical solution of the embodiment of the present invention, the master device generates a fifth pulse signal according to the multi-byte first underwater acoustic information sent by the slave device, and marks a fifth timestamp at the edge of the fifth pulse signal; generates multi-byte second underwater acoustic information according to the local time, and sends the second underwater acoustic information to the slave device; generates a sixth pulse signal according to the second underwater acoustic information, and marks a sixth timestamp at the edge of the sixth pulse signal; calculates and obtains first timing information according to each fifth timestamp and each sixth timestamp, and sends it to the slave device, so that the slave device updates the local time based on the first timing information. Thereby, not only the clock consistency between the master device and the slave device is achieved, the clock signal synchronization efficiency is improved, but also based on the transmission mode of underwater acoustic communication, while realizing the wireless transmission of signals, the signal transmission distance is greatly extended.
[0092] Embodiment III
[0093] Figure 5 FIG. is a schematic diagram of the interaction process of a timing method based on underwater acoustic communication provided in Embodiment III of the present invention. In this embodiment, through the interaction between the slave device and the master device, it is ensured that the slave device maintains clock consistency with the master device, as Figure 5 shown, the method includes:
[0094] The slave device generates multi-byte first underwater acoustic information according to the local time, and sends the first underwater acoustic information to the master device; the slave device generates a first pulse signal according to the first underwater acoustic information, and marks a first timestamp at the edge of the first pulse signal; the master device generates a fifth pulse signal according to the multi-byte first underwater acoustic information sent by the slave device, and marks a fifth timestamp at the edge of the fifth pulse signal; the master device generates multi-byte second underwater acoustic information according to the local time, and sends the second underwater acoustic information to the slave device.
[0095] The slave device generates a second pulse signal according to the second underwater acoustic information, and marks a second timestamp at the edge of the second pulse signal; the master device generates a sixth pulse signal according to the second underwater acoustic information, and marks a sixth timestamp at the edge of the sixth pulse signal; the master device calculates and obtains first timing information according to each fifth timestamp and each sixth timestamp, and sends the first timing information to the slave device; the slave device calculates and obtains a first master-slave time difference according to each first timestamp, each second timestamp and the first timing information, and updates the local time according to the first master-slave time difference.
[0096] The technical solution of the embodiment of the present invention not only realizes the clock consistency between the master device and the slave device, improves the clock signal synchronization efficiency, but also based on the transmission mode of underwater acoustic communication, while realizing the wireless transmission of signals, greatly extends the signal transmission distance.
[0097] Embodiment IV
[0098] Figure 6It is a structural block diagram of a timing device based on underwater acoustic communication provided by the fourth embodiment of the present invention, specifically including:
[0099] The first information sending module 401 is configured to generate multi-byte first underwater acoustic information according to the local time, and send the first underwater acoustic information to the master device, so that the master device feeds back second underwater acoustic information and first timing information based on the first underwater acoustic information;
[0100] The first pulse generating module 402 is configured to generate a first pulse signal according to the first underwater acoustic information, and mark a first timestamp at the edge of the first pulse signal; wherein, the number of first pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0101] The first information receiving module 403 is configured to generate a second pulse signal according to the second underwater acoustic information, and mark a second timestamp at the edge of the second pulse signal; wherein, the number of second pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0102] The timing information receiving module 404 is configured to calculate and obtain a first master-slave time difference according to each of the first timestamps, each of the second timestamps and the first timing information, and update the local time according to the first master-slave time difference.
[0103] In the technical solution of the embodiment of the present invention, the slave device generates multi-byte first underwater acoustic information according to the local time, and sends the first underwater acoustic information to the master device; the slave device generates a first pulse signal according to the first underwater acoustic information, and marks a first timestamp at the edge of the first pulse signal; the slave device generates a second pulse signal according to the second underwater acoustic information fed back by the master device, and marks a second timestamp at the edge of the second pulse signal; the slave device updates the local time according to the first timestamp, the second timestamp and the first timing information fed back by the master device. Thereby, not only the clock consistency between the master device and the slave device is achieved, the clock signal synchronization efficiency is improved, but also based on the transmission mode of underwater acoustic communication, while realizing wireless signal transmission, the signal transmission distance is greatly extended.
[0104] Optionally, the timing device based on underwater acoustic communication is further configured to generate a first pulse signal according to the first underwater acoustic information based on a preset pulse rule; determine whether the second pulse signal conforms to the preset pulse rule; if it is determined that the second pulse signal conforms to the preset pulse rule, calculate and obtain a first master-slave time difference according to each of the first timestamps, each of the second timestamps and the first timing information; if it is determined that the second pulse signal does not conform to the preset pulse rule, discard the first timing information and do not update the local time.
[0105] Optionally, the time synchronization device based on underwater acoustic communication is further configured to determine whether the first time synchronization information is valid according to the time synchronization result identifier of the first time synchronization information; if it is determined that the first time synchronization information is invalid, discard the first time synchronization information and do not update the local time; if it is determined that the first time synchronization information is valid, calculate and obtain the first master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first time synchronization information.
[0106] Optionally, the time synchronization device based on underwater acoustic communication is further configured to continue to generate multi-byte first underwater acoustic information according to the local time, and send the first underwater acoustic information to the master device, so that the master device feeds back second underwater acoustic information and first time synchronization information based on the first underwater acoustic information; continue to generate a first pulse signal according to the first underwater acoustic information, and mark a first timestamp at the edge of the first pulse signal, and generate a second pulse signal according to the second underwater acoustic information, and mark a second timestamp at the edge of the second pulse signal; calculate and obtain a second master-slave time difference according to each of the first timestamps, each of the second timestamps, and the first time synchronization information; determine whether the difference between the first master-slave time difference and the second master-slave time difference is less than or equal to a preset time difference threshold; if it is determined that it is less than or equal to the preset time difference threshold, update the local time according to the first master-slave time difference and the second master-slave time difference.
[0107] Optionally, the time synchronization device based on underwater acoustic communication is further configured to, if it is determined that the difference is greater than the preset time difference threshold, generate multi-byte third underwater acoustic information according to the local time, and send the third underwater acoustic information to the master device, so that the master device feeds back fourth underwater acoustic information and second time synchronization information based on the third underwater acoustic information; wherein, the number of bytes of the third underwater acoustic information is greater than the number of bytes of the first underwater acoustic information; generate a third pulse signal according to the third underwater acoustic information, and mark a third timestamp at the edge of the third pulse signal; wherein, the number of third pulse signals is equal to the number of bytes of the third underwater acoustic information; generate a fourth pulse signal according to the fourth underwater acoustic information, and mark a fourth timestamp at the edge of the fourth pulse signal; wherein, the number of fourth pulse signals is equal to the number of bytes of the third underwater acoustic information; calculate and obtain a third master-slave time difference according to each of the third timestamps, each of the fourth timestamps, and the second time synchronization information, and update the local time according to the first master-slave time difference, the second master-slave time difference, and the third master-slave time difference.
[0108] The above device can execute the underwater acoustic communication-based time synchronization method provided in the first embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the underwater acoustic communication-based time synchronization method provided in any embodiment of the present invention.
[0109] Embodiment Five
[0110] Figure 7It is a structural block diagram of a time synchronization device based on underwater acoustic communication provided by the fifth embodiment of the present invention, specifically including:
[0111] A second information receiving module 501, configured to generate a fifth pulse signal according to the multi-byte first underwater acoustic information sent by the slave device, and mark a fifth time stamp at the edge of the fifth pulse signal; wherein, the number of the fifth pulse signals is equal to the number of bytes of the first underwater acoustic information;
[0112] A second information sending module 502, configured to generate multi-byte second underwater acoustic information according to the local time, and send the second underwater acoustic information to the slave device, so that the slave device generates a second pulse signal based on the second underwater acoustic information;
[0113] A second pulse generating module 503, configured to generate a sixth pulse signal according to the second underwater acoustic information, and mark a sixth time stamp at the edge of the sixth pulse signal; wherein, the number of the sixth pulse signals is equal to the number of bytes of the second underwater acoustic information;
[0114] A time synchronization information sending module 504, configured to calculate and obtain first time synchronization information according to each of the fifth time stamps and each of the sixth time stamps, and send the first time synchronization information to the slave device, so that the slave device updates the local time based on the first time synchronization information.
[0115] In the technical solution of the embodiment of the present invention, the master device generates a fifth pulse signal according to the multi-byte first underwater acoustic information sent by the slave device, and marks a fifth time stamp at the edge of the fifth pulse signal; generates multi-byte second underwater acoustic information according to the local time, and sends the second underwater acoustic information to the slave device; generates a sixth pulse signal according to the second underwater acoustic information, and marks a sixth time stamp at the edge of the sixth pulse signal; calculates and obtains first time synchronization information according to each of the fifth time stamps and each of the sixth time stamps, and sends it to the slave device, so that the slave device updates the local time based on the first time synchronization information. Thereby, not only the clock consistency between the master device and the slave device is achieved, the clock signal synchronization efficiency is improved, but also based on the transmission mode of underwater acoustic communication, while realizing the wireless transmission of signals, the signal transmission distance is greatly extended.
[0116] The above device can execute the time synchronization method based on underwater acoustic communication provided by the second embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For the technical details not described in detail in this embodiment, reference can be made to the time synchronization method based on underwater acoustic communication provided in any embodiment of the present invention.
[0117] Embodiment Six
[0118] Figure 8FIG. 0 shows a schematic structural diagram of an electronic device 10 that can be used to implement embodiments of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, blade electronic devices, mainframe computers, and other suitable computers. The electronic device 10 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0119] As Figure 8 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0120] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0121] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the time synchronization method based on underwater acoustic communication.
[0122] In some embodiments, the time synchronization method based on underwater acoustic communication can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed onto the heterogeneous hardware accelerator via the ROM and / or the communication unit. When the computer program is loaded into the RAM and executed by the processor, one or more steps of the time synchronization method based on underwater acoustic communication described above can be performed. Alternatively, in other embodiments, the processor can be configured to execute the time synchronization method based on underwater acoustic communication by any other suitable means (e.g., by means of firmware).
[0123] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or electronic device.
[0125] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] For purposes of providing interaction with a user, the systems and techniques described herein can be implemented on a heterogeneous hardware accelerator that has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the heterogeneous hardware accelerator. Other kinds of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0127] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data electronic device), or a computing system that includes middleware components (e.g., an application electronic device), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0128] A computing system may include a client and an electronic device. The client and the electronic device are generally far from each other and usually interact via a communication network. The relationship between the client and the electronic device is generated by computer programs running on respective computers and having a client-electronic device relationship with each other. The electronic device may be a cloud electronic device, also known as a cloud computing electronic device or a cloud host, which is a host product in a cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0129] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0130] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A timing method based on underwater acoustic communication, characterized in that: Applicable to slave devices, including: Generate multi-byte first water acoustic information according to local time, and send the first water acoustic information to the master device, so that the master device feeds back second water acoustic information and first timing information based on the first water acoustic information; wherein the first timing information is obtained based on the fifth timestamp and the sixth timestamp; the fifth timestamp reflects the receiving time of each byte of the first water acoustic information; the sixth timestamp reflects the sending time of each byte of the second water acoustic information; Generate a first pulse signal according to the first hydroacoustic information, and mark a first timestamp at the edge of the first pulse signal; wherein the number of the first pulse signals is equal to the number of bytes of the first hydroacoustic information; Generate a second pulse signal according to the second hydroacoustic information, and mark a second timestamp at the edge of the second pulse signal; wherein the number of the second pulse signals is equal to the number of bytes of the first hydroacoustic information; A first master-slave time difference is calculated and obtained according to each of the first timestamps, each of the second timestamps and the first timing information, and a local time is updated according to the first master-slave time difference.
2. The method according to claim 1, characterized in that The step of generating a first pulse signal according to the first hydroacoustic information comprises: Based on a preset pulse rule, generating a first pulse signal according to the first hydroacoustic information; The calculating and obtaining a first master-slave time difference according to each of the first timestamps, each of the second timestamps and the first timing information includes: Determining whether the second pulse signal meets the preset pulse rule; If it is determined that the second pulse signal meets the preset pulse rule, a first master-slave time difference is calculated and obtained according to each of the first timestamps, each of the second timestamps and the first timing information; If it is determined that the second pulse signal does not comply with the preset pulse rule, the first timing information is discarded and the local time is not updated.
3. The method according to claim 2, characterized in that After determining that the second pulse signal meets the preset pulse rule, the method further includes: Determining whether the first timing information is valid according to the timing result identifier of the first timing information; If it is determined that the first timing information is invalid, the first timing information is discarded and the local time is not updated; If it is determined that the first timing information is valid, a first master-slave time difference is calculated based on each of the first timestamps, each of the second timestamps and the first timing information.
4. The method according to claim 1, characterized in that: The updating of the local time according to the first master-slave time difference comprises: Continue to generate multi-byte first water acoustic information according to the local time, and send the first water acoustic information to the master device, so that the master device feeds back second water acoustic information and first timing information again based on the first water acoustic information; Continue to generate a first pulse signal according to the first hydroacoustic information, and mark a first timestamp at the edge of the first pulse signal, and generate a second pulse signal according to the second hydroacoustic information, and mark a second timestamp at the edge of the second pulse signal; Calculate and obtain a second master-slave time difference according to each of the first timestamps, each of the second timestamps and the first timing information; Determine whether the difference between the first master-slave time difference and the second master-slave time difference is less than or equal to a preset time difference threshold; If it is determined that the time difference is less than or equal to the preset time difference threshold, the local time is updated according to the first master-slave time difference and the second master-slave time difference.
5. The method according to claim 4, characterized in that After determining whether the difference between the first master-slave time difference and the second master-slave time difference is less than or equal to a preset time difference threshold, the method further includes: If it is determined that the time difference is greater than the preset time difference threshold, a multi-byte third water acoustic information is generated according to the local time, and the third water acoustic information is sent to the master device, so that the master device feeds back the fourth water acoustic information and the second timing information based on the third water acoustic information; wherein the number of bytes of the third water acoustic information is greater than the number of bytes of the first water acoustic information; Generate a third pulse signal according to the third hydroacoustic information, and mark a third timestamp at the edge of the third pulse signal; wherein the number of the third pulse signals is equal to the number of bytes of the third hydroacoustic information; Generate a fourth pulse signal according to the fourth hydroacoustic information, and mark a fourth timestamp at the edge of the fourth pulse signal; wherein the number of the fourth pulse signals is equal to the number of bytes of the third hydroacoustic information; A third master-slave time difference is calculated and obtained according to each of the third timestamps, each of the fourth timestamps and the second timing information, and a local time is updated according to the first master-slave time difference, the second master-slave time difference and the third master-slave time difference.
6. A timing method based on underwater acoustic communication, characterized in that: Applicable to main equipment, including: Generate a fifth pulse signal according to the multi-byte first water acoustic information sent from the device, and mark a fifth timestamp at the edge of the fifth pulse signal; wherein the number of the fifth pulse signals is equal to the number of bytes of the first water acoustic information; and the fifth timestamp reflects the reception time of each byte of the first water acoustic information; Generate multi-byte second water acoustic information according to the local time, and send the second water acoustic information to the slave device, so that the slave device generates a second pulse signal based on the second water acoustic information; Generate a sixth pulse signal according to the second hydroacoustic information, and mark a sixth timestamp at the edge of the sixth pulse signal; wherein the number of the sixth pulse signals is equal to the number of bytes of the second hydroacoustic information; and the sixth timestamp reflects the time when each byte of the second hydroacoustic information is sent; According to each of the fifth timestamps and each of the sixth timestamps, the first timing information is calculated and obtained, and the first timing information is sent to the slave device, so that the slave device updates the local time based on each of the first timestamps, each of the second timestamps and the first timing information; wherein the first timestamp reflects the time when each byte of the first underwater acoustic information is sent; and the second timestamp reflects the time when each byte of the second underwater acoustic information is received.
7. A timing device based on underwater acoustic communication, characterized in that: Applicable to slave devices, including: A first information sending module is used to generate multi-byte first water acoustic information according to local time, and send the first water acoustic information to a master device, so that the master device feeds back second water acoustic information and first timing information based on the first water acoustic information; wherein the first timing information is obtained based on a fifth timestamp and a sixth timestamp; the fifth timestamp reflects the receiving time of each byte of the first water acoustic information; and the sixth timestamp reflects the sending time of each byte of the second water acoustic information; A first pulse generating module, used for generating a first pulse signal according to the first hydroacoustic information, and marking a first timestamp on the edge of the first pulse signal; wherein the number of the first pulse signals is equal to the number of bytes of the first hydroacoustic information; A first information receiving module, used to generate a second pulse signal according to the second hydroacoustic information, and mark a second timestamp at the edge of the second pulse signal; wherein the number of the second pulse signals is equal to the number of bytes of the first hydroacoustic information; A timing information receiving module is used to calculate and obtain a first master-slave time difference according to each of the first timestamps, each of the second timestamps and the first timing information, and update the local time according to the first master-slave time difference.
8. A timing device based on underwater acoustic communication, characterized in that: Applicable to main equipment, including: A second information receiving module is used to generate a fifth pulse signal according to the multi-byte first water acoustic information sent from the device, and mark a fifth timestamp at the edge of the fifth pulse signal; wherein the number of the fifth pulse signals is equal to the number of bytes of the first water acoustic information; and the fifth timestamp reflects the reception time of each byte of the first water acoustic information; A second information sending module, used for generating multi-byte second water acoustic information according to local time, and sending the second water acoustic information to a slave device, so that the slave device generates a second pulse signal based on the second water acoustic information; A second pulse generating module, used for generating a sixth pulse signal according to the second hydroacoustic information, and marking a sixth timestamp at the edge of the sixth pulse signal; wherein the number of the sixth pulse signals is equal to the number of bytes of the second hydroacoustic information; and the sixth timestamp reflects the time when each byte of the second hydroacoustic information is sent; A timing information sending module is used to calculate and obtain the first timing information based on each of the fifth timestamps and each of the sixth timestamps, and send the first timing information to the slave device, so that the slave device updates the local time based on each of the first timestamps, each of the second timestamps and the first timing information; wherein the first timestamp reflects the time when each byte of the first underwater acoustic information is sent; and the second timestamp reflects the time when each byte of the second underwater acoustic information is received.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the timing method based on underwater acoustic communication as described in any one of claims 1 to 5, or execute the timing method based on underwater acoustic communication as described in claim 6.
10. A computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a processor to implement the timing method based on underwater acoustic communication according to any one of claims 1 to 5, or to implement the timing method based on underwater acoustic communication according to claim 6 when executed.
Citation Information
Patent Citations
HPLC (High Performance Liquid Chromatography) communication time-frequency value calibration method and system for electric energy metering equipment
CN118118116A