CN114222360A - Time synchronization method, system and related device - Google Patents

Time synchronization method, system and related device Download PDF

Info

Publication number
CN114222360A
CN114222360A CN202111576830.5A CN202111576830A CN114222360A CN 114222360 A CN114222360 A CN 114222360A CN 202111576830 A CN202111576830 A CN 202111576830A CN 114222360 A CN114222360 A CN 114222360A
Authority
CN
China
Prior art keywords
time
synchronization time
synchronization
communication link
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111576830.5A
Other languages
Chinese (zh)
Other versions
CN114222360B (en
Inventor
赵兴景
田万均
刘建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Opper Software Technology Co ltd
Original Assignee
Nanjing Opper Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Opper Software Technology Co ltd filed Critical Nanjing Opper Software Technology Co ltd
Priority to CN202111576830.5A priority Critical patent/CN114222360B/en
Publication of CN114222360A publication Critical patent/CN114222360A/en
Application granted granted Critical
Publication of CN114222360B publication Critical patent/CN114222360B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a time synchronization method, a system and a related device, which are applied to first equipment, wherein the method comprises the following steps: determining a communication channel between a first device and a second device, the communication channel comprising a first communication link and a second communication link; determining P first synchronous time deviations and Q second synchronous time deviations between first equipment and second equipment in a data packet exchange mode; the first synchronous time deviation is the synchronous time deviation of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronous time deviation is the synchronous time deviation of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers; and determining a target synchronous time deviation of the communication channel according to the P first synchronous time deviations and the Q second synchronous time deviations. The time synchronization deviation between the devices is accurately determined by adopting the embodiment of the application.

Description

Time synchronization method, system and related device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, a system, and a related device for time synchronization.
Background
In the field of communication technology, data interaction between different communication devices can be performed through corresponding channels. However, because some unavoidable differences exist in hardware of different communication devices, and differences to signal transmission delay exist in power-on and power-off or design of a control chip in the communication device, the more complex system design is, the more obvious the time difference is, and the higher the requirement on time synchronism is. In addition, the default communication path is symmetric when calculating the path delay and time difference. In the communication process, the uplink and the downlink are not necessarily symmetrical, and a time synchronization error is also caused, so that how to accurately determine the time synchronization deviation between the devices is urgently needed to be solved.
Disclosure of Invention
The embodiment of the application provides a time synchronization method, a time synchronization system and a related device, which can accurately determine time synchronization deviation between devices.
In a first aspect, an embodiment of the present application provides a time synchronization method, which is applied to a first device, and the method includes:
determining a communication channel between the first device and a second device, the communication channel comprising a first communication link and a second communication link;
determining P first synchronous time deviations and Q second synchronous time deviations between the first equipment and the second equipment in a data packet exchange mode; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers;
and determining the target synchronous time deviation of the communication channel according to the P first synchronous time deviations and the Q second synchronous time deviations.
In a second aspect, an embodiment of the present application provides a time synchronization apparatus, which is applied to a first device, and the apparatus includes: a first determination unit, a second determination unit, and a third determination unit, wherein,
the first determining unit is configured to determine a communication channel between the first device and a second device, where the communication channel includes a first communication link and a second communication link;
the second determining unit is configured to determine, by exchanging packets, P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers;
the third determining unit is configured to determine a target synchronization time offset of the communication channel according to the P first synchronization time offsets and the Q second synchronization time offsets.
In a third aspect, an embodiment of the present application provides a first device, which includes a processor, and a memory, where the memory is configured to store one or more programs and is configured to be executed by the processor, and the program includes instructions for performing some or all of the steps described in the first party.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program enables a computer to perform some or all of the steps described in the first aspect of the embodiment of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
In a sixth aspect, an embodiment of the present application provides a time synchronization system, which includes the first device and the second device as described in the third aspect.
The embodiment of the application has the following beneficial effects:
it can be seen that the time synchronization method, system and related apparatus described in the embodiments of the present application are applied to a first device, determine a communication channel between the first device and a second device, where the communication channel includes a first communication link and a second communication link, and determine P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device by exchanging data packets, where the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels, and the second synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of symmetric channels; p, Q are positive integers, the target synchronization time deviation of the communication channel is determined according to the P first synchronization time deviations and the Q second synchronization time deviations, and the time synchronization deviation between the devices can be accurately determined because the influence of the asymmetry of the communication link is considered in the time synchronization deviation determination process.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a software structure of an electronic device according to an embodiment of the present application;
fig. 3A is a schematic architecture diagram of a time synchronization system for implementing a time synchronization method according to an embodiment of the present application;
fig. 3B is a schematic architecture diagram of another time synchronization system for implementing the time synchronization method according to the embodiment of the present application;
fig. 4A is a schematic flowchart of a time synchronization method according to an embodiment of the present application;
fig. 4B is a schematic flowchart of a method for exchanging data packets according to an embodiment of the present application;
fig. 4C is a schematic flowchart of another time synchronization method provided in the embodiment of the present application;
fig. 5 is a schematic flowchart of another time synchronization method provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
fig. 7 is a block diagram illustrating functional units of a time synchronization apparatus according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
In order to better understand the scheme of the embodiments of the present application, the following first introduces the related terms and concepts that may be involved in the embodiments of the present application.
The terms "first," "second," "third," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
In a specific implementation, in this embodiment of the application, the first device, the second device, and the third device may all be electronic devices, and the electronic devices may include various devices having a computer function, for example, a handheld device (a smart phone, a tablet computer, and the like), a vehicle-mounted device (a navigator, an auxiliary car backing system, a vehicle recorder, a vehicle-mounted refrigerator, and the like), a wearable device (a smart bracelet, a wireless headset, a smart watch, smart glasses, and the like), a computing device, or other processing devices connected to a wireless modem, and various forms of User Equipment (UE), a Mobile Station (MS), a virtual reality/augmented reality device, a terminal device (terminal device), and the like, and the electronic devices may also be a base Station or a server.
The electronic device may further include an intelligent home device, and the intelligent home device may be at least one of: intelligent audio amplifier, intelligent camera, intelligent electric rice cooker, intelligent wheelchair, intelligent massage armchair, intelligent furniture, intelligent dish washer, intelligent TV set, intelligent refrigerator, intelligent electric fan, intelligent room heater, intelligent clothes hanger that dries in the air, intelligent lamp, intelligent router, intelligent switch, intelligent flush mounting plate, intelligent humidifier, intelligent air conditioner, intelligent door, intelligent window, intelligent top of a kitchen range, intelligent sterilizer, intelligent closestool, the robot etc. of sweeping the floor do not restrict here.
In a first section, the software and hardware operating environment of the technical solution disclosed in the present application is described as follows.
As shown, fig. 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a compass 190, a motor 191, a pointer 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an application processor AP, a modem processor, a graphics processor GPU, an image time synchronizer (ISP), a controller, a video codec, a digital time synchronizer (DSP), a baseband processor, and/or a neural network processor NPU, among others. Wherein the different processing units may be separate components or may be integrated in one or more processors. In some embodiments, the electronic device 101 may also include one or more processors 110. The controller can generate an operation control signal according to the instruction operation code and the time sequence signal to complete the control of instruction fetching and instruction execution. In other embodiments, a memory may also be provided in processor 110 for storing instructions and data. Illustratively, the memory in the processor 110 may be a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from memory. This avoids repeated accesses and reduces the latency of the processor 110, thereby increasing the efficiency with which the electronic device 101 processes data or executes instructions. The processor may also include an image processor, which may be an image Pre-processor (Pre-ISP), which may be understood as a simplified ISP, which may also perform some image processing operations, e.g. may obtain image statistics.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a SIM card interface, a USB interface, and/or the like. The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 101, and may also be used to transmit data between the electronic device 101 and peripheral devices. The USB interface 130 may also be used to connect to a headset to play audio through the headset.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G/6G, etc. applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (blue tooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (mini-light-emitting diode, mini), a Micro-o led, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or more display screens 194.
The electronic device 100 may implement a photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or more cameras 193.
The digital time synchronizer is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital time synchronizer is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 121 may be used to store one or more computer programs, including instructions. The processor 110 may execute the above-mentioned instructions stored in the internal memory 121, so as to enable the electronic device 101 to execute the method for displaying page elements provided in some embodiments of the present application, and various applications and data processing. The internal memory 121 may include a program storage area and a data storage area. Wherein, the storage program area can store an operating system; the storage program area may also store one or more applications (e.g., gallery, contacts, etc.), and the like. The storage data area may store data (such as photos, contacts, etc.) created during use of the electronic device 101, and the like. Further, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage components, flash memory components, Universal Flash Storage (UFS), and the like. In some embodiments, the processor 110 may cause the electronic device 101 to execute the method for displaying page elements provided in the embodiments of the present application, and other applications and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor 110. The electronic device 100 may implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. Such as music playing, recording, etc.
The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., X, Y and the Z axis) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
Fig. 2 shows a block diagram of a software structure of the electronic device 100. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom. The application layer may include a series of application packages.
As shown in fig. 2, the application layer may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
In the second section, a time synchronization method and a related apparatus disclosed in the embodiments of the present application are described as follows.
Referring to fig. 3A or fig. 3B, fig. 3A or fig. 3B is a schematic diagram of an architecture of a time synchronization system for implementing a time synchronization method according to an embodiment of the present application, as shown in fig. 3A, the time synchronization system may include a first device and a second device, and the first device and the second device may directly establish a communication channel, and as shown in fig. 3B, the time synchronization system may also establish the communication channel through a third device (e.g., a base station, a server, a repeater, a switch, and the like). The number of the third devices may be one or more.
The communication mode between the first device and the second device may include at least one of the following: a mobile communication mode (2G, 3G, 4G, 5G, 6G, etc.), a bluetooth communication mode, an infrared communication mode, a wireless fidelity (Wi-Fi) communication mode, a Zigbee communication mode, an Ultra Wide Band (UWB), a low power consumption communication mode (such as LoRa), a visible light communication mode, a millimeter wave communication mode, a satellite communication mode, etc., which are not limited herein.
Based on the time synchronization system described in fig. 3A or fig. 3B, the following time synchronization method may be performed:
determining a communication channel between the first device and a second device, the communication channel comprising a first communication link and a second communication link;
determining P first synchronous time deviations and Q second synchronous time deviations between the first equipment and the second equipment in a data packet exchange mode; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers;
and determining the target synchronous time deviation of the communication channel according to the P first synchronous time deviations and the Q second synchronous time deviations.
In the embodiment of the application, in the process of determining the time synchronization deviation, the influence of asymmetry of the communication link is considered, so that the time synchronization deviation between the devices can be accurately determined.
Further, referring to fig. 4A, fig. 4A is a schematic flowchart of a time synchronization method provided in an embodiment of the present application, where the time synchronization method is applied to the first device shown in fig. 1 or fig. 2, and the first device may be applied to the time synchronization system shown in fig. 3A or fig. 3B, as shown in the figure, the time synchronization method includes:
401. a communication channel between the first device and a second device is determined, the communication channel including a first communication link and a second communication link.
The first communication link is an uplink communication link, and the second communication link is a downlink communication link, or the first communication link is a downlink communication link and the second communication link is an uplink communication link.
In a specific implementation, considering asymmetry of a communication link, for a communication channel between a first device and a second device, there may be some differences between a first communication link and a second communication link, and channel parameters of an upper communication link and a lower communication link may be different at different times, and network delays caused by different channel parameters may also be different, and the network delays may be a specific time length value. For example, the network delay between the first communication link and the second communication link is different. The channel parameter may include at least one of: channel bandwidth, channel congestion level, channel signal-to-noise ratio, noise power, channel gain, transmission power, etc., without limitation.
402. Determining P first synchronous time deviations and Q second synchronous time deviations between the first equipment and the second equipment in a data packet exchange mode; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers.
In a specific implementation, the data packet exchanging manner may be understood as that two devices send a data packet to each other, for example, a device a sends a data packet to a device B, and the device B sends a feedback data packet for the data packet to the device a, where the process may be referred to as a one-time data packet exchanging process; for another example, the B device sends a packet to the a device, and the a device sends a feedback packet for the packet to the B device, which may also be referred to as a one-time packet exchange process.
The first synchronization time offset may be synchronization time offsets of the first communication link and the second communication link under the condition of asymmetric channels, and the first synchronization time offsets of each time are different because the network delays of each time are different. The second synchronization time offset may be a synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry, and the second synchronization time offset is different each time due to the influence of device hardware and the influence of software level, and the influence of the device hardware may include at least one ofThe method comprises the following steps: a processor, clock, antenna, etc., without limitation; the software-level impact may include at least one of: the packing/unpacking of the data packet, the calling or parsing of the relevant protocol, etc. are not limited herein, and even if the same code is used, there will be some differences in the completion time during the execution process. In the embodiment of the present application, the first synchronization time offset may be written as: t isoffset_realThe second synchronization time offset can be written as: t isoffset_calculate
In particular implementations, a first synchronization time offset may be determined for an exchange of data packets, and/or a second synchronization time offset may be determined for an exchange of data packets, i.e., a first synchronization time offset may be determined for an exchange of data packets, or a second synchronization time offset may be determined for an exchange of data packets, or a first synchronization time offset and a second synchronization time offset may be determined for an exchange of data packets. In a specific implementation, P and Q may be equal or unequal, but both P and Q are positive integers. In this embodiment of the present application, P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device may be determined by exchanging data packets at least once.
Optionally, the first device is a sender and the second device is a receiver, or the first device is a receiver and the second device is a sender.
In a specific implementation, in the process of exchanging data packets, for a first device and a second device, if one of the two devices is a sender, the other is a receiver.
Optionally, when the first device is a sender and the second device is a receiver, the step 402 of determining P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device by exchanging data packets may include the following steps:
21. sending a first data packet to the second device through the first communication link, wherein the data packet carries a first timestamp corresponding to the sending time of the first data packet;
22. receiving a second data packet fed back by the second device for the first data packet through the second communication link, and generating a fourth timestamp; the second data packet carries a second timestamp and a third timestamp, the second timestamp is a timestamp generated when the second device receives the first data packet, and the third timestamp is a data packet generated when the second device sends the second data packet;
23. and determining the first synchronization time deviation and the second synchronization time deviation according to the first time stamp, the second time stamp, the third time stamp and the fourth time stamp, wherein the first synchronization time deviation is any one of the P first synchronization time deviations, and the second synchronization time deviation is any one of the Q second synchronization time deviations.
In this embodiment of the present application, as shown in fig. 4B, in a process of exchanging a data packet, a first device may send a first data packet (Sync) to a second device through a first communication link, where the data packet carries a first timestamp Ta1,Ta1A timestamp generated for the time at which the first packet was sent. The second device may receive the first data packet, may generate a second data packet (Req) for the first data packet, and may send the second data packet to the first device, and the second device may generate a second timestamp T at the time of receiving the first data packetb1The second device generates a third time stamp T at the moment of sending the second data packetb2The first device generates a fourth timestamp T at the moment of reception of the second data packeta2. The second data packet may be understood as a feedback data packet for the first data packet.
Further, optionally, in step 23, determining the first synchronization time offset and the second synchronization time offset according to the first time stamp, the second time stamp, the third time stamp, and the fourth time stamp may include the following steps:
231. determining the second synchronization time offset from the first time stamp, the second time stamp, a third time stamp, and the fourth time stamp;
232. acquiring a first network delay parameter of the first communication link and a second network delay parameter of the second communication link;
233. determining the first synchronization time offset according to the second synchronization time offset, the first network delay parameter, and the second network delay parameter.
In a specific implementation, in this embodiment of the present application, the first network delay parameter may be denoted as Td1The second network delay parameter may be denoted as Td2. The first network delay parameter and the second network delay parameter may each be a specific length of time value, the first network delay parameter may be determined by a time period between a first time stamp and a second time stamp corresponding to the first communication link or a channel parameter of at least one time point, and the second network delay parameter may be determined by a time period between a third time stamp and a fourth time stamp corresponding to the second communication link or a channel parameter of at least one time point.
For example, in a specific implementation, when the first device sends the first data packet to the second device through the first communication link, the following formula may be obtained in consideration of the network delay of the first communication link and the first synchronization time offset:
Ta1+Td1+Toffset_real=Tb1 (1)
further, when the second device sends a second packet fed back for the first packet to the first device through the second communication link, the following formula can be obtained in consideration of the network delay of the second communication link and the first synchronization time offset:
Tb2+Td2-Toffset_real=Ta2 (2)
further, the following calculation formula of the first synchronization time deviation can be obtained from the above formula (1) and formula (2):
Figure BDA0003424334860000091
wherein, the second synchronization time deviation can be calculated according to the following formula:
Figure BDA0003424334860000092
further, substituting equation (4) into equation (3) may result in the following equation:
Figure BDA0003424334860000093
in a particular implementation, if the communication link is symmetric, then Td1And Td2Equal, if uplink and downlink are asymmetric, then Td1May be greater than Td2And may be smaller than Td2. But T is only established if the first device and the second device are connectedd1And Td2Is always bounded, and therefore T can be givend1-Td2When a random process with a mean of 0 is considered, equation (5) can be transformed into equation (6) as follows:
Toffset_calculate=Toffset_real-noise (6)
then
Figure BDA0003424334860000094
Which can be used to represent synchronization time errors caused by channel asymmetry.
403. And determining the target synchronous time deviation of the communication channel according to the P first synchronous time deviations and the Q second synchronous time deviations.
In a specific implementation, it can be detected whether the communication channel meets the time synchronization accuracy requirement set in advance according to the P first synchronization time offsets and the Q second synchronization time offsets, where different time synchronization accuracy requirements correspond to different accuracy thresholds, for example, a preset accuracy threshold may be obtained and the mean of the P first synchronization time deviations may be determined, an average first synchronization time deviation may be obtained, the mean of the Q second synchronization time deviations may be determined, an average second synchronization time deviation may be obtained, the absolute value of the difference between the first synchronization time deviation and the second synchronization time deviation may be determined, when the absolute value is smaller than the preset precision threshold, the communication channel meets the time synchronization precision requirement preset by time, and then weighting operation can be carried out according to the P first synchronization time deviations and the Q second synchronization time deviations to obtain the target synchronization time deviation.
Of course, in a specific implementation, a target synchronization time offset of the communication channel may be determined directly by a part or all of the P first synchronization time offsets and a part or all of the Q second synchronization time offsets, for example, any one of the P first synchronization time offsets and any one of the Q second synchronization time offsets may be selected, and the selected first synchronization time offset and the selected second synchronization time offset are used to perform weighted average operation, so as to obtain the target synchronization time offset.
Optionally, when P, Q is all 1, the second synchronization time offset is a second synchronization time offset obtained by exchanging packets for the kth time, and the first synchronization time offset is a first synchronization time offset obtained by exchanging packets for the last a times of the kth time; a is a positive integer;
in the step 402, determining the target synchronization time offset of the communication channel according to the P first synchronization time offsets and the Q second synchronization time offsets may include the following steps:
a21, determining a first absolute value of the difference between the first synchronous time deviation and the second synchronous time deviation;
and A22, when the first absolute value is smaller than a first preset threshold value, performing weighted operation according to the first synchronous time deviation and the second synchronous time deviation to obtain the target synchronous time deviation.
The first preset threshold may be understood as a time synchronization accuracy threshold, the first preset threshold may be preset or default to a system, the first preset threshold is greater than 0, and a specific value of the first preset threshold may be related to the time synchronization accuracy or the time synchronization purpose, for example, the closer the first preset threshold is to 0, the higher the required time synchronization accuracy is. In the embodiment of the present application, the first preset threshold may be denoted as limit.
In a specific implementation, when P, Q is all 1, taking the kth time data packet exchange as an example, the second synchronization time offset may be a second synchronization time offset obtained by exchanging data packets at the kth time, and the first synchronization time offset may be a first synchronization time offset obtained by exchanging data packets at the last a times of the kth time; if a is a positive integer, for example, a is 1, the first synchronization time offset may be the first synchronization time offset obtained by exchanging packets in the last 1 time of the kth time.
Specifically, a difference between the first synchronization time offset and the second synchronization time offset may be determined, and since the difference may be a positive number or a negative number, an absolute value may be obtained from the difference to obtain a first absolute value, and if the first absolute value is smaller than a first preset threshold, it indicates that the time synchronization precision of the channel meets the time synchronization precision requirement required by the user.
Furthermore, when the first absolute value is smaller than the first preset threshold, a weight corresponding to the first synchronization time deviation and the second synchronization time deviation may be determined, and then a weighted operation may be performed on the first synchronization time deviation and the second synchronization time deviation based on the weight to obtain a target synchronization time deviation, which is specifically expressed by the following formula (7):
Ttarget=λToffset_real(K-1)+(1-λ)Toffset_calculate(K) (7)
wherein, Toffset_calculate(K) Second synchronization time offset, T, corresponding to the K-th exchange packetoffset_real(K-1) is the first synchronous time deviation corresponding to the K-1 th exchange data packet, lambda and 1-lambda are weight values, TtargetThe target synchronization time deviation can be obtained, and the value range of lambda can be 0-1, for example, lambda belongs to [0.25,0.75 ]]。
For example, as shown in FIG. 4C, the timestamp can be obtained by exchanging data packetsCalculating a second synchronization time offset T determined by exchanging data packets for the Kth time based on the time stampoffset_calculate(K) And a first synchronization time offset T determined by the K-1 th exchange of data packetsoffset_real(K-1) detection of Toffset_calculate(K) And Toffset_realWhether the difference value between the (K-1) is smaller than a first preset threshold limit or not, and if so, according to Toffset_calculate(K) And Toffset_real(K-1) performing weighting operation to obtain a target synchronous time deviation TtargetOtherwise, the timestamp can be continuously acquired in a data packet exchange mode, and the steps are repeated again based on the timestamp.
Since the two devices have established a connection, the communication link does not change when the timestamp is sent a limited number of times, thus ensuring that the absolute value calculated within the limited number of times is less than limit, e.g. the limited number of times may be 2 nd, or 5 th.
Optionally, in the step a22, the target synchronization time offset is obtained by performing a weighted operation according to the first synchronization time offset and the second synchronization time offset, and the method may be implemented as follows:
a221, acquiring a plurality of historical second synchronous time deviations;
a222, determining target mean square deviations corresponding to the plurality of historical second synchronous time deviations;
a223, determining a target adjusting coefficient corresponding to the target mean square error according to a mapping relation between a preset mean square error and an adjusting coefficient;
a224, adjusting the second synchronous time deviation according to the target adjusting coefficient to obtain a target second synchronous time deviation;
and A225, performing weighting operation according to the first synchronous time deviation and the target second synchronous time deviation to obtain the target synchronous time deviation.
In a specific implementation, a plurality of historical second synchronization time deviations can be obtained, each historical second synchronization time deviation is determined by exchanging data packets, further, a target mean square error corresponding to the plurality of historical second synchronization time deviations can be determined, the mean square error reflects a fluctuation condition of channel asymmetry, further, a target adjustment coefficient corresponding to the target mean square error can be determined according to a mapping relation between a preset mean square error and an adjustment coefficient, a value range of the adjustment parameter can be-1 to 1, for example, -0.1 to 0.1, and then the second synchronization time deviation is adjusted according to the target adjustment coefficient to obtain the target second synchronization time deviation, which is specifically as follows:
target second synchronization time offset (1+ target adjustment factor) second synchronization time offset
And finally, determining a weight corresponding to the first synchronization time deviation and the target second synchronization time deviation, and performing weighting operation according to the first synchronization time deviation and the target second synchronization time deviation based on the weight to obtain the target synchronization time deviation.
Further, optionally, the method may further include the following steps:
when the first absolute value is greater than or equal to the first preset threshold, determining X first synchronization time deviations and Y second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the X first synchronization time deviations and/or the Y second synchronization time deviations are used for determining the target synchronization time deviation, X, Y is a natural number, and X and Y cannot be 0 at the same time;
in a specific implementation, when the first absolute value is greater than or equal to the first preset threshold, it indicates that the time synchronization accuracy of the channel meets the time synchronization accuracy requirement required by the user, and further, X first synchronization time deviations and Y second synchronization time deviations between the first device and the second device, X first synchronization time deviations, and/or Y second synchronization time deviations can be determined by exchanging data packets to determine a target synchronization time deviation, X, Y is a natural number, and X and Y cannot be 0 at the same time, for example, if the time synchronization accuracy of the channel meets the time synchronization accuracy requirement required by the user can be determined again by using the first synchronization time deviation corresponding to the K +1 th exchange data packet and the second synchronization time deviation corresponding to the K th exchange data packet, and when the time synchronization accuracy of the channel meets the time synchronization accuracy requirement required by the user, then, a weighting operation can be performed on the first synchronous time deviation corresponding to the K +1 th exchange data packet and the second synchronous time deviation corresponding to the K-th exchange data packet to obtain the target synchronous time deviation.
Further, optionally, the method may further include the following steps:
when the first absolute value is greater than or equal to the first preset threshold, determining the absolute value of the difference between the first absolute value and the first preset threshold to obtain a second absolute value;
when the second absolute value is smaller than or equal to a second preset threshold, determining M first synchronization time deviations and N second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the M first synchronization time deviations and/or the N second synchronization time deviations are used for determining the target synchronization time deviation, M, N is a natural number, and M and N cannot be 0 at the same time.
In this embodiment of the application, the second preset threshold may be preset or default to a system, the second preset threshold is greater than 0, and the size relationship between the first preset threshold and the second preset threshold may be indefinite, for example, the second preset threshold may be greater than the first preset threshold, or the second preset threshold may be smaller than the first preset threshold, or the second preset threshold may also be equal to the first preset threshold.
In a specific implementation, when the first absolute value is greater than or equal to the first preset threshold, it may further be determined whether the time deviation is too large, that is, an absolute value of a difference between the first absolute value and the first preset threshold may be determined to obtain a second absolute value, and when the second absolute value is less than or equal to the second preset threshold, it indicates that the time deviation is within a reasonable range to a large extent, M first synchronization time deviations and N second synchronization time deviations between the first device and the second device, M first synchronization time deviations, and/or N second synchronization time deviations may be used to determine a target synchronization time deviation, M, N is a natural number, and M and N cannot be 0 at the same time. For example, whether the time synchronization accuracy of the channel meets the time synchronization accuracy requirement required by the user can be determined again through the first synchronization time deviation corresponding to the K +1 th exchange data packet and the second synchronization time deviation corresponding to the K th exchange data packet, and under the condition that the time synchronization accuracy of the channel meets the time synchronization accuracy requirement required by the user, the first synchronization time deviation corresponding to the K +1 th exchange data packet and the second synchronization time deviation corresponding to the K th exchange data packet can be used for performing weighting operation to obtain a target synchronization time deviation.
Further, the method can also comprise the following steps:
and when the second absolute value is larger than the second preset threshold, prompting to modify the device parameter of the first device and/or the device parameter of the second device.
When the second absolute value is greater than the second preset threshold, it is indicated that the time synchronization accuracy of the channel does not completely meet the time synchronization accuracy requirement required by the user, and even if the time synchronization accuracy detection is performed in a data packet exchange manner, the time synchronization accuracy requirement required by the user cannot be met, the modification of the device parameter of the first device may be prompted, or the modification of the device parameter of the second device may also be prompted, or the modification of the device parameters of the first device and the modification of the device parameter of the second device may also be prompted. The device parameters may include at least one parameter affecting time synchronization, and the device parameters may include hardware parameters, and/or software parameters. The hardware parameters may include at least one of: processor-related parameters, antenna-related parameters, communication module-related parameters, clock hardware parameters, and the like, without limitation. The software parameters may include: protocol related parameters, unpacking/packing related parameters, clock software parameters, etc., without limitation. The clock hardware parameters may include: the frequency of the clock, the accuracy of the clock, etc., are not limited herein. The clock software parameters may include parameters of a clock algorithm, which may include at least one of: the type of the clock algorithm, the control parameters of the clock algorithm, and the like are not limited herein, different clock algorithms may correspond to different control parameters, and the control parameters may be used to control the computation complexity or the clock accuracy of the clock.
Optionally, the method may further include the following steps:
when data are synchronized, correcting an entry timestamp synchronized to the second equipment by the first equipment and/or a write timestamp according to the target synchronization time deviation;
alternatively, the first and second electrodes may be,
and correcting the entry time stamp and/or the write time stamp synchronized to the first equipment by the second equipment according to the target synchronization time deviation when the data are synchronized.
In specific implementation, when data synchronization is performed, at least one of an entry timestamp and a write timestamp of the second device synchronized to the first device can be corrected according to the target synchronization time deviation, and at least one of an entry timestamp and a write timestamp of the first device synchronized to the second device can be corrected according to the target synchronization time deviation, so that the data synchronization time can be accurately determined.
For example, the target synchronization time offset calculated by the first device between the two devices may be used to correct the entry timestamp and the write timestamp synchronized by the second device according to the time difference when data synchronization is performed, and in a specific implementation, although the synchronization time offset caused by the asymmetry of the communication link cannot be eliminated, adverse effects caused by the asymmetry of the communication link may be reduced. The specific form of the number of data pieces is shown in the following table:
Figure BDA0003424334860000121
Figure BDA0003424334860000131
the data entry may include the following: key (key value of data entry), value (data corresponding to key), timestamp (entry timestamp), w _ timestamp (write timestamp, timestamp when data entry is saved), etc., and is not limited herein.
Specifically, assume, for example, that the calculated synchronization time offset is-3 seconds, i.e., the first device is 3 seconds slower than the second device. At this time, the second device synchronizes a piece of data to the first device, and assuming that the timestamp is 1200s, the entry timestamp of the data entry generated by the second device on the first device is 1200+ (-3) 1197 s, and the calibration manner of w _ timestamp (write timestamp) is similar to the entry timestamp, and is not described herein again.
For another example, based on the above embodiments of the present application, when the time used by the first device and the time used by the second device are not in the same time zone, time zone calibration may also be performed. Assume that the second device is in tokyo using the east 7 zone time, and the first device is in china (china) using the east 8 zone time. Then the second device is one hour faster than the first device. In this case, the actual time difference is time difference + synchronization time difference, which is time difference due to different areas. Assume that the synchronization time offset is-3 seconds, i.e., the first device is 3 seconds slower than the second device. At this time, the second device synchronizes a piece of data to the first device with a timestamp of 10000s, and then the entry timestamp for the second device to generate the data entry is 10000+ (-1 × 60) + (-3) (-6397 seconds) on the first device.
Optionally, in step 403, determining the target synchronization time offset of the communication channel according to the P first synchronization time offsets and the Q second synchronization time offsets may include the following steps:
b31, determining a first mean value and a first standard deviation of the P first synchronous time deviations;
b32, determining a second mean value and a second standard deviation of the Q second synchronous time deviations;
b33, determining a first weight and a second weight according to the first standard deviation and the second standard deviation;
and B34, performing weighting operation according to the first average value, the second average value, the first weight and the second weight to obtain the target synchronization time deviation.
In a specific implementation, the first standard deviation reflects fluctuation of a synchronization time deviation caused by channel asymmetry of the device, and the second standard deviation reflects fluctuation of the synchronization time deviation caused by uncertainty of the device.
Specifically, a first mean and a first standard deviation of P first synchronization time deviations and a second mean and a second standard deviation of Q second synchronization time deviations may be determined, and then, a first weight and a second weight may be determined according to the first standard deviation and the second standard deviation, which is as follows:
the first weight is equal to the second standard deviation/(the first standard deviation + the second standard deviation), the second weight is equal to the first standard deviation/(the first standard deviation + the second standard deviation), and the target synchronization time deviation is equal to the first weight, the first mean value + the second weight, and the second mean value.
In the specific implementation, the occurrence probability of a larger synchronization time deviation can be reduced by the mean value of the first synchronization time deviation and the mean value of the second synchronization time deviation determined by exchanging data packets for multiple times, in addition, based on the standard deviation concept in probability theory, the fluctuation condition between the first synchronization time deviation and the second synchronization time deviation is determined, based on the fluctuation condition, the weight value pair (the first weight value and the second weight value) is determined, the fluctuation is large, the corresponding weight value is small, the fluctuation is small, the corresponding weight value is large, further, the determined target synchronization time deviation can be more stable, and meanwhile, the time synchronization deviation can be accurately obtained.
It can be seen that the time synchronization method described in the embodiment of the present application is applied to a first device, determines a communication channel between the first device and a second device, where the communication channel includes a first communication link and a second communication link, and determines P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device by exchanging packets, where the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link when the channels are asymmetric, and the second synchronization time offset is a synchronization time offset of the first communication link and the second communication link when the channels are symmetric; p, Q are positive integers, the target synchronization time deviation of the communication channel is determined according to the P first synchronization time deviations and the Q second synchronization time deviations, and the time synchronization deviation between the devices can be accurately determined because the influence of the asymmetry of the communication link is considered in the time synchronization deviation determination process.
In accordance with the above-mentioned fig. 4A, the present application provides please refer to fig. 5, and fig. 5 is a schematic flowchart of a time synchronization method provided in an embodiment of the present application, applied to a first device, the method includes:
501. a communication channel between the first device and a second device is determined, the communication channel including a first communication link and a second communication link.
502. Determining a first synchronous time deviation corresponding to the data packet exchanged this time between the first device and the second device and a second synchronous time deviation corresponding to the data packet exchanged last time; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is a synchronization time offset of the first communication link and the second communication link under a condition of channel symmetry.
503. A first absolute value of a difference between the first synchronization time offset and the second synchronization time offset is determined.
504. And when the first absolute value is smaller than a first preset threshold value, performing weighting operation according to the first synchronous time deviation and the second synchronous time deviation to obtain the target synchronous time deviation.
The detailed description of the above steps 501-504 can refer to the related description of the time synchronization method described in fig. 4A, and is not repeated herein.
It can be seen that the time synchronization method described in the embodiment of the present application is applied to a first device, determines a communication channel between the first device and a second device, where the communication channel includes a first communication link and a second communication link, determines a first synchronization time offset corresponding to a present exchange packet between the first device and the second device and a second synchronization time offset corresponding to a last exchange packet between the first device and the second device, where the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels, the second synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of symmetric channels, determines a first absolute value of a difference between the first synchronization time offset and the second synchronization time offset, and performs a weighting operation according to the first synchronization time offset and the second synchronization time offset when the first absolute value is smaller than a first preset threshold, the target synchronization time deviation is obtained, and because the influence of the asymmetry of the communication link is considered in the time synchronization deviation determining process, and the final time synchronization deviation is determined by combining the synchronization time deviations under the two times of data packet exchange before and after the time synchronization deviation determining process, the error caused by the asymmetry of the communication link can be reduced to a certain extent, and further, the time synchronization deviation between the devices can be accurately determined.
Referring to fig. 6 in keeping with the above embodiments, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown, the electronic device may be a first device, the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and in an embodiment of the present application, the programs include instructions for performing the following steps:
determining a communication channel between the first device and a second device, the communication channel comprising a first communication link and a second communication link;
determining P first synchronous time deviations and Q second synchronous time deviations between the first equipment and the second equipment in a data packet exchange mode; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers;
and determining the target synchronous time deviation of the communication channel according to the P first synchronous time deviations and the Q second synchronous time deviations.
Optionally, when P, Q is all 1, the second synchronization time offset is a second synchronization time offset obtained by exchanging packets for the kth time, and the first synchronization time offset is a first synchronization time offset obtained by exchanging packets for the last a times of the kth time; a is a positive integer;
in said determining a target synchronization time offset for said communication channel based on said P first synchronization time offsets and said Q second synchronization time offsets, said program comprising instructions for:
determining a first absolute value of a difference between the first synchronization time offset and the second synchronization time offset;
and when the first absolute value is smaller than a first preset threshold value, performing weighting operation according to the first synchronous time deviation and the second synchronous time deviation to obtain the target synchronous time deviation.
Optionally, the program further includes instructions for performing the following steps:
when the first absolute value is greater than or equal to the first preset threshold, determining X first synchronization time deviations and Y second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the X first synchronization time deviations and/or the Y second synchronization time deviations are used for determining the target synchronization time deviation, X, Y is a natural number, and X and Y cannot be 0 at the same time;
alternatively, the first and second electrodes may be,
when the first absolute value is greater than or equal to the first preset threshold, determining the absolute value of the difference between the first absolute value and the first preset threshold to obtain a second absolute value;
when the second absolute value is smaller than or equal to a second preset threshold, determining M first synchronization time deviations and N second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the M first synchronization time deviations and/or the N second synchronization time deviations are used for determining the target synchronization time deviation, M, N is a natural number, and M and N cannot be 0 at the same time.
Optionally, the program further comprises instructions for performing the steps of:
and when the second absolute value is larger than the second preset threshold, prompting to modify the device parameter of the first device and/or the device parameter of the second device.
Optionally, the program further includes instructions for performing the following steps:
when data are synchronized, correcting an entry timestamp synchronized to the second equipment by the first equipment and/or a write timestamp according to the target synchronization time deviation;
alternatively, the first and second electrodes may be,
and correcting the entry time stamp and/or the write time stamp synchronized to the first equipment by the second equipment according to the target synchronization time deviation when the data are synchronized.
Optionally, the first device is a sender and the second device is a receiver, or the first device is a receiver and the second device is a sender.
Optionally, when the first device is a sender and the second device is a receiver, in the aspect of determining P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device by exchanging data packets, the program includes instructions for performing the following steps:
sending a first data packet to the second device through the first communication link, wherein the data packet carries a first timestamp corresponding to the sending time of the first data packet;
receiving a second data packet fed back by the second device for the first data packet through the second communication link, and generating a fourth timestamp; the second data packet carries a second timestamp and a third timestamp, the second timestamp is a timestamp generated when the second device receives the first data packet, and the third timestamp is a data packet generated when the second device sends the second data packet;
and determining the first synchronization time deviation and the second synchronization time deviation according to the first time stamp, the second time stamp, the third time stamp and the fourth time stamp, wherein the first synchronization time deviation is any one of the P first synchronization time deviations, and the second synchronization time deviation is any one of the Q second synchronization time deviations.
Optionally, in the aspect of determining the first synchronization time offset and the second synchronization time offset according to the first time stamp, the second time stamp, the third time stamp, and the fourth time stamp, the program includes instructions for performing the following steps:
determining the second synchronization time offset from the first time stamp, the second time stamp, a third time stamp, and the fourth time stamp;
acquiring a first network delay parameter of the first communication link and a second network delay parameter of the second communication link;
determining the first synchronization time offset according to the second synchronization time offset, the first network delay parameter, and the second network delay parameter.
It can be seen that, in the first device described in the embodiment of the present application, a communication channel between the first device and the second device is determined, where the communication channel includes a first communication link and a second communication link, and P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device are determined by exchanging data packets, where the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link in a case of channel asymmetry, and the second synchronization time offset is a synchronization time offset of the first communication link and the second communication link in a case of channel symmetry; p, Q are positive integers, the target synchronization time deviation of the communication channel is determined according to the P first synchronization time deviations and the Q second synchronization time deviations, and the time synchronization deviation between the devices can be accurately determined because the influence of the asymmetry of the communication link is considered in the time synchronization deviation determination process.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and algorithm steps described in connection with the embodiments provided herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 7 is a block diagram of functional units of a time synchronization apparatus 700 according to an embodiment of the present application. The time synchronization apparatus 700 is applied to a first device, and the apparatus 700 includes: a first determination unit 701, a second determination unit 702, and a third determination unit 703, wherein,
the first determining unit 701 is configured to determine a communication channel between the first device and a second device, where the communication channel includes a first communication link and a second communication link;
the second determining unit 702 is configured to determine P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device by exchanging data packets; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers;
the third determining unit 703 is configured to determine a target synchronization time offset of the communication channel according to the P first synchronization time offsets and the Q second synchronization time offsets.
Optionally, when P, Q is all 1, the second synchronization time offset is a second synchronization time offset obtained by exchanging packets for the kth time, and the first synchronization time offset is a first synchronization time offset obtained by exchanging packets for the last a times of the kth time; a is a positive integer;
in the aspect of determining the target synchronization time offset of the communication channel according to the P first synchronization time offsets and the Q second synchronization time offsets, the third determining unit 703 is specifically configured to:
determining a first absolute value of a difference between the first synchronization time offset and the second synchronization time offset;
and when the first absolute value is smaller than a first preset threshold value, performing weighting operation according to the first synchronous time deviation and the second synchronous time deviation to obtain the target synchronous time deviation.
Optionally, the apparatus 700 is further specifically configured to:
when the first absolute value is greater than or equal to the first preset threshold, determining X first synchronization time deviations and Y second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the X first synchronization time deviations and/or the Y second synchronization time deviations are used for determining the target synchronization time deviation, X, Y is a natural number, and X and Y cannot be 0 at the same time;
alternatively, the first and second electrodes may be,
when the first absolute value is greater than or equal to the first preset threshold, determining the absolute value of the difference between the first absolute value and the first preset threshold to obtain a second absolute value;
when the second absolute value is smaller than or equal to a second preset threshold, determining M first synchronization time deviations and N second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the M first synchronization time deviations and/or the N second synchronization time deviations are used for determining the target synchronization time deviation, M, N is a natural number, and M and N cannot be 0 at the same time.
Optionally, the apparatus 700 is further specifically configured to:
and when the second absolute value is larger than the second preset threshold, prompting to modify the device parameter of the first device and/or the device parameter of the second device.
Optionally, the apparatus 700 is further specifically configured to:
when data are synchronized, correcting an entry timestamp synchronized to the second equipment by the first equipment and/or a write timestamp according to the target synchronization time deviation;
alternatively, the first and second electrodes may be,
and correcting the entry time stamp and/or the write time stamp synchronized to the first equipment by the second equipment according to the target synchronization time deviation when the data are synchronized.
Optionally, the first device is a sender and the second device is a receiver, or the first device is a receiver and the second device is a sender.
Optionally, when the first device is a sender and the second device is a receiver, in the aspect of determining P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device in a data packet exchange manner, the second determining unit 702 is specifically configured to:
sending a first data packet to the second device through the first communication link, wherein the data packet carries a first timestamp corresponding to the sending time of the first data packet;
receiving a second data packet fed back by the second device for the first data packet through the second communication link, and generating a fourth timestamp; the second data packet carries a second timestamp and a third timestamp, the second timestamp is a timestamp generated when the second device receives the first data packet, and the third timestamp is a data packet generated when the second device sends the second data packet;
and determining the first synchronization time deviation and the second synchronization time deviation according to the first time stamp, the second time stamp, the third time stamp and the fourth time stamp, wherein the first synchronization time deviation is any one of the P first synchronization time deviations, and the second synchronization time deviation is any one of the Q second synchronization time deviations.
Optionally, in the aspect that the first synchronization time offset and the second synchronization time offset are determined according to the first time stamp, the second time stamp, the third time stamp, and the fourth time stamp, the second determining unit 702 is specifically configured to:
determining the second synchronization time offset from the first time stamp, the second time stamp, a third time stamp, and the fourth time stamp;
acquiring a first network delay parameter of the first communication link and a second network delay parameter of the second communication link;
determining the first synchronization time offset according to the second synchronization time offset, the first network delay parameter, and the second network delay parameter.
It can be seen that the time synchronization system described in the embodiment of the present application is applied to a first device, determines a communication channel between the first device and a second device, where the communication channel includes a first communication link and a second communication link, and determines P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device by exchanging packets, where the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link when the channels are asymmetric, and the second synchronization time offset is a synchronization time offset of the first communication link and the second communication link when the channels are symmetric; p, Q are positive integers, the target synchronization time deviation of the communication channel is determined according to the P first synchronization time deviations and the Q second synchronization time deviations, and the time synchronization deviation between the devices can be accurately determined because the influence of the asymmetry of the communication link is considered in the time synchronization deviation determination process.
It should be noted that the electronic device described in the embodiments of the present application is presented in the form of a functional unit. The term "unit" as used herein is to be understood in its broadest possible sense, and objects used to implement the functions described by the respective "unit" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated, or chipset) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
The first determining unit 701, the second determining unit 702, and the third determining unit 703 may be a processor or a communication unit, and the processor may be an artificial intelligence chip, an NPU, a CPU, a GPU, or the like, which is not limited herein. The functions or steps of any of the above methods can be implemented based on the above unit modules.
The present embodiment also provides a time synchronization system, which includes a first device and a second device, where the first device may be configured to implement any of the methods in the foregoing embodiments to determine a synchronization time offset between the first device and the second device.
The present embodiment also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes a computer to execute the embodiments of the present application to implement any one of the methods in the embodiments.
The present embodiment also provides a computer program product, which when run on a computer causes the computer to execute the relevant steps described above to implement any of the methods in the above embodiments.
In addition, embodiments of the present application further provide a time synchronization apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a processor and a memory connected to each other; the memory is used for storing computer execution instructions, and when the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip can execute any one of the methods in the above method embodiments.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Through the description of the above embodiments, those skilled in the art will understand that, for convenience and simplicity of description, only the division of the above functional modules is used as an example, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A time synchronization method applied to a first device, the method comprising:
determining a communication channel between the first device and a second device, the communication channel comprising a first communication link and a second communication link;
determining P first synchronous time deviations and Q second synchronous time deviations between the first equipment and the second equipment in a data packet exchange mode; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers;
and determining the target synchronous time deviation of the communication channel according to the P first synchronous time deviations and the Q second synchronous time deviations.
2. The method of claim 1, wherein when P, Q are all 1, the second synchronization time offset is a second synchronization time offset obtained by exchanging packets for the Kth time, and the first synchronization time offset is a first synchronization time offset obtained by exchanging packets for the last a times of the Kth time; a is a positive integer;
determining a target synchronization time offset for the communication channel based on the P first synchronization time offsets and the Q second synchronization time offsets, comprising:
determining a first absolute value of a difference between the first synchronization time offset and the second synchronization time offset;
and when the first absolute value is smaller than a first preset threshold value, performing weighting operation according to the first synchronous time deviation and the second synchronous time deviation to obtain the target synchronous time deviation.
3. The method of claim 2, further comprising:
when the first absolute value is greater than or equal to the first preset threshold, determining X first synchronization time deviations and Y second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the X first synchronization time deviations and/or the Y second synchronization time deviations are used for determining the target synchronization time deviation, X, Y is a natural number, and X and Y cannot be 0 at the same time;
alternatively, the first and second electrodes may be,
when the first absolute value is greater than or equal to the first preset threshold, determining the absolute value of the difference between the first absolute value and the first preset threshold to obtain a second absolute value;
when the second absolute value is smaller than or equal to a second preset threshold, determining M first synchronization time deviations and N second synchronization time deviations between the first device and the second device by means of the exchange data packet, where the M first synchronization time deviations and/or the N second synchronization time deviations are used for determining the target synchronization time deviation, M, N is a natural number, and M and N cannot be 0 at the same time.
4. The method of claim 3, further comprising:
and when the second absolute value is larger than the second preset threshold, prompting to modify the device parameter of the first device and/or the device parameter of the second device.
5. The method of claim 4, further comprising:
when data are synchronized, correcting an entry timestamp synchronized to the second equipment by the first equipment and/or a write timestamp according to the target synchronization time deviation;
alternatively, the first and second electrodes may be,
and correcting the entry time stamp and/or the write time stamp synchronized to the first equipment by the second equipment according to the target synchronization time deviation when the data are synchronized.
6. The method of any of claims 1-5, wherein the first device is a sender and the second device is a receiver, or wherein the first device is a receiver and the second device is a sender.
7. The method according to any one of claims 1 to 6, wherein when the first device is a sender and the second device is a receiver, the determining P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device by exchanging data packets comprises:
sending a first data packet to the second device through the first communication link, wherein the data packet carries a first timestamp corresponding to the sending time of the first data packet;
receiving a second data packet fed back by the second device for the first data packet through the second communication link, and generating a fourth timestamp; the second data packet carries a second timestamp and a third timestamp, the second timestamp is a timestamp generated when the second device receives the first data packet, and the third timestamp is a data packet generated when the second device sends the second data packet;
and determining the first synchronization time deviation and the second synchronization time deviation according to the first time stamp, the second time stamp, the third time stamp and the fourth time stamp, wherein the first synchronization time deviation is any one of the P first synchronization time deviations, and the second synchronization time deviation is any one of the Q second synchronization time deviations.
8. The method of claim 7, wherein determining the first synchronization time offset and the second synchronization time offset from the first time stamp, the second time stamp, a third time stamp, and the fourth time stamp comprises:
determining the second synchronization time offset from the first time stamp, the second time stamp, a third time stamp, and the fourth time stamp;
acquiring a first network delay parameter of the first communication link and a second network delay parameter of the second communication link;
determining the first synchronization time offset according to the second synchronization time offset, the first network delay parameter, and the second network delay parameter.
9. A time synchronization apparatus applied to a first device, the apparatus comprising: a first determination unit, a second determination unit, and a third determination unit, wherein,
the first determining unit is configured to determine a communication channel between the first device and a second device, where the communication channel includes a first communication link and a second communication link;
the second determining unit is configured to determine, by exchanging packets, P first synchronization time offsets and Q second synchronization time offsets between the first device and the second device; the first synchronization time offset is a synchronization time offset of the first communication link and the second communication link under the condition of asymmetric channels; the second synchronization time offset is the synchronization time offset of the first communication link and the second communication link under the condition of channel symmetry; p, Q are all positive integers;
the third determining unit is configured to determine a target synchronization time offset of the communication channel according to the P first synchronization time offsets and the Q second synchronization time offsets.
10. A first device, characterized in that the first device comprises a processor, a memory for storing one or more programs and configured to be executed by the processor, the programs comprising instructions for carrying out the steps in the method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-8.
12. A time synchronization system, characterized in that it comprises a first device and a second device according to claim 10.
CN202111576830.5A 2021-12-21 2021-12-21 Time synchronization method, system and related device Active CN114222360B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111576830.5A CN114222360B (en) 2021-12-21 2021-12-21 Time synchronization method, system and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111576830.5A CN114222360B (en) 2021-12-21 2021-12-21 Time synchronization method, system and related device

Publications (2)

Publication Number Publication Date
CN114222360A true CN114222360A (en) 2022-03-22
CN114222360B CN114222360B (en) 2023-09-12

Family

ID=80704895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111576830.5A Active CN114222360B (en) 2021-12-21 2021-12-21 Time synchronization method, system and related device

Country Status (1)

Country Link
CN (1) CN114222360B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098219A (en) * 2005-12-23 2008-01-02 安捷伦科技有限公司 Correcting time synchronisation inaccuracy caused by asymmetric delay on a communication link
JP2009065579A (en) * 2007-09-10 2009-03-26 Nec Corp Time synchronizing system, time synchronizing method, node, and program
US20100002817A1 (en) * 2008-07-01 2010-01-07 Qualcomm Incorporated Method and apparatus for adaptive timing synchronization in a communication network
CN102111258A (en) * 2009-12-25 2011-06-29 华为技术有限公司 Clock synchronization method, equipment and system
CN102291196A (en) * 2011-08-17 2011-12-21 中兴通讯股份有限公司 Implementation method and device for detecting asymmetrical time delay of 1588 link circuit automatically
CN102932905A (en) * 2011-08-10 2013-02-13 中兴通讯股份有限公司 Method and system for realizing self-compensation 1588 link asynchronous time delay
US20160286260A1 (en) * 2015-03-24 2016-09-29 Intel Corporation Distributed media stream synchronization control
CN109787704A (en) * 2019-03-01 2019-05-21 燕山大学 A kind of time deviation compensation method based on asymmetric link
CN110662283A (en) * 2018-06-28 2020-01-07 华为技术有限公司 Clock synchronization method and device
CN111342926A (en) * 2020-02-28 2020-06-26 盛科网络(苏州)有限公司 Method for optimizing time synchronization of PTP (precision time protocol) in asymmetric network
WO2021169698A1 (en) * 2020-02-26 2021-09-02 华为技术有限公司 Connection management method and related device
CN113472468A (en) * 2020-03-31 2021-10-01 华为技术有限公司 Synchronization method, device, equipment and storage medium
CN113746509A (en) * 2020-05-28 2021-12-03 维沃移动通信有限公司 Channel information processing method and device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098219A (en) * 2005-12-23 2008-01-02 安捷伦科技有限公司 Correcting time synchronisation inaccuracy caused by asymmetric delay on a communication link
JP2009065579A (en) * 2007-09-10 2009-03-26 Nec Corp Time synchronizing system, time synchronizing method, node, and program
US20100002817A1 (en) * 2008-07-01 2010-01-07 Qualcomm Incorporated Method and apparatus for adaptive timing synchronization in a communication network
CN102111258A (en) * 2009-12-25 2011-06-29 华为技术有限公司 Clock synchronization method, equipment and system
CN102932905A (en) * 2011-08-10 2013-02-13 中兴通讯股份有限公司 Method and system for realizing self-compensation 1588 link asynchronous time delay
CN102291196A (en) * 2011-08-17 2011-12-21 中兴通讯股份有限公司 Implementation method and device for detecting asymmetrical time delay of 1588 link circuit automatically
US20160286260A1 (en) * 2015-03-24 2016-09-29 Intel Corporation Distributed media stream synchronization control
CN110662283A (en) * 2018-06-28 2020-01-07 华为技术有限公司 Clock synchronization method and device
CN109787704A (en) * 2019-03-01 2019-05-21 燕山大学 A kind of time deviation compensation method based on asymmetric link
WO2021169698A1 (en) * 2020-02-26 2021-09-02 华为技术有限公司 Connection management method and related device
CN111342926A (en) * 2020-02-28 2020-06-26 盛科网络(苏州)有限公司 Method for optimizing time synchronization of PTP (precision time protocol) in asymmetric network
CN113472468A (en) * 2020-03-31 2021-10-01 华为技术有限公司 Synchronization method, device, equipment and storage medium
CN113746509A (en) * 2020-05-28 2021-12-03 维沃移动通信有限公司 Channel information processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张艳;韩雁;霍明旭;陈金龙;廉玉平;: "基于EPA协议的精确时钟同步方法", 传感技术学报, no. 07 *
李利;卓越;: "基于通信传输网链路不对称算法改进", 南方能源建设, no. 01 *

Also Published As

Publication number Publication date
CN114222360B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
EP4024168A1 (en) Hand gesture interaction method and apparatus, and terminal device
WO2021104104A1 (en) Energy-efficient display processing method, and apparatus
EP4024837A1 (en) Device capability scheduling method and electronic device
CN114513847B (en) Positioning method, device, system, electronic equipment and storage medium
US20230386382A1 (en) Display method, electronic device, and computer storage medium
WO2023000772A1 (en) Mode switching method and apparatus, electronic device and chip system
CN113115439A (en) Positioning method and related equipment
CN112181616B (en) Task processing method and related device
CN111835907A (en) Method, equipment and system for switching service across electronic equipment
EP4395290A1 (en) Bluetooth audio playback method, electronic device, and storage medium
KR102524305B1 (en) Connection establishment method and terminal device
CN114915996A (en) Communication exception handling method and related device
CN114827696B (en) Method for synchronously playing audio and video data of cross-equipment and electronic equipment
WO2022170866A1 (en) Data transmission method and apparatus, and storage medium
CN111836226B (en) Data transmission control method, device and storage medium
CN114222360B (en) Time synchronization method, system and related device
CN114336998A (en) Charging control method, charging control device and storage medium
CN114630152A (en) Parameter transmission method and device for image processor and storage medium
CN111615207A (en) Resource mapping method, device and storage medium
CN114125738B (en) Data transmission control method and related device
WO2024066834A1 (en) Vsync signal control method, electronic device, storage medium and chip
CN114630153B (en) Parameter transmission method and device for application processor and storage medium
CN115378550B (en) Signal transmission control method, system and related device
CN114596819B (en) Brightness adjusting method and related device
WO2023193720A1 (en) Control method and central control equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant