CN115802471A - Clock synchronization method and equipment - Google Patents

Clock synchronization method and equipment Download PDF

Info

Publication number
CN115802471A
CN115802471A CN202111060843.7A CN202111060843A CN115802471A CN 115802471 A CN115802471 A CN 115802471A CN 202111060843 A CN202111060843 A CN 202111060843A CN 115802471 A CN115802471 A CN 115802471A
Authority
CN
China
Prior art keywords
value
determining
count
counting
absolute time
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.)
Pending
Application number
CN202111060843.7A
Other languages
Chinese (zh)
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.)
Chengdu TD Tech Ltd
Original Assignee
Chengdu TD Tech 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 Chengdu TD Tech Ltd filed Critical Chengdu TD Tech Ltd
Priority to CN202111060843.7A priority Critical patent/CN115802471A/en
Publication of CN115802471A publication Critical patent/CN115802471A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Electric Clocks (AREA)

Abstract

The application provides a clock synchronization method and equipment, and relates to the technical field of communication. The method comprises the following steps: under the condition that the electronic equipment is connected with the wireless access network equipment, receiving first absolute time sent by the wireless access network equipment; determining a first count value of a counter corresponding to a local clock in unit time corresponding to a first absolute time; and under the condition that the electronic equipment is disconnected from the wireless access network equipment, determining a second absolute time corresponding to the local clock according to the first count value. The method and the device can determine a first count value of the local clock in unit time corresponding to a first absolute time issued by the wireless access network equipment when the electronic equipment is connected with the wireless access network equipment, so that the local clock is calibrated according to the first count value when the electronic equipment is disconnected with the wireless access network equipment. Therefore, the accuracy of the local clock is improved, and the accuracy of the communication time of the electronic equipment is further improved.

Description

Clock synchronization method and equipment
Technical Field
The present application relates to the field of clock synchronization technologies, and in particular, to a clock synchronization method and device.
Background
In various industrial and non-industrial scenarios, the electronic device used, which may be a terminal device or a communication module, usually requires a precise time. For example, in an industrial scenario, a terminal device for controlling a production facility uses an accurate time in order to accurately control the production facility for production. In a smart grid system, time may be used for accurate transmission and distribution of power. The engineer can accurately determine the power failure place according to the time of the abnormal condition of the power system. Therefore, the terminal devices in the smart grid system also need to use accurate time. Different scenes have different requirements on the accuracy of time. For example, in a differential protection scenario of a power system, the requirement for time precision is 1 microsecond, the requirement for time precision of a PMU (phasor measurement unit) of the power system is 10 microseconds, the requirement for time precision of a cooperative scenario of a dual AGV (automated guided vehicle) is 100 microseconds, the requirement for time precision of a static instrument used for aerospace is 1 to 2 microseconds, and the requirement for time precision of a clock is 10 microseconds, but 1 millisecond may also meet the requirement, and in a data acquisition scenario with a sampling rate of 1000 hertz, the requirement for time precision is 100 microseconds.
Therefore, how to improve the accuracy of the time of using the electronic device is an urgent problem to be solved.
Disclosure of Invention
The application provides a clock synchronization method and equipment, which are used for improving the accuracy of the time used by electronic equipment.
In a first aspect, the present application provides a clock synchronization method applied to an electronic device, including:
under the condition that the electronic equipment is connected with a wireless access network device, receiving a first absolute time sent by the wireless access network device;
determining a first count value of a counter corresponding to a local clock in unit time corresponding to the first absolute time;
and under the condition that the electronic equipment is disconnected from the wireless access network equipment, determining a second absolute time corresponding to the local clock according to the first count value.
Optionally, the determining, according to the first count value, a second absolute time corresponding to the local clock includes:
determining the difference value between the first count value and a standard count value of the counter in a plurality of unit times to obtain a count difference value corresponding to each unit time;
determining a reference count difference value according to the count difference value corresponding to each unit time;
determining a third count value from the sum of the reference count difference and the standard count value;
and determining a second absolute time corresponding to the local clock according to the third counting value.
Optionally, the determining a second absolute time corresponding to the local clock according to the third count value includes:
counting by the counter to obtain a second count value;
and when the second counting value reaches the third counting value, increasing the current second absolute time by the unit time to obtain the updated second absolute time.
Optionally, the determining a reference count difference according to the count difference corresponding to each unit time includes:
determining the last determined count difference as the reference count difference; or the like, or, alternatively,
determining a statistical value of the count difference values corresponding to a plurality of the unit times as a reference count difference value, the statistical value including one of: mean, maximum, minimum.
Optionally, the determining a third count value according to the sum of the reference count difference value and the standard count value comprises:
determining a counting compensation value of the current temperature, wherein the counting compensation value is used for compensating a counting error in unit time corresponding to the current temperature;
and determining a third counting value according to the sum of the reference counting difference value and the standard counting value and the counting compensation value of the current temperature.
Optionally, the method further comprises:
converting the second absolute time to a time code output, the time code including at least one of: parallel time codes, serial time codes.
Optionally, the counter is a nanosecond counter, the unit time is 1 second, and the local clock of the electronic device is a crystal oscillator clock.
In a second aspect, the present application provides a clock synchronization apparatus applied to an electronic device, including:
the first absolute time receiving module is used for receiving a first absolute time sent by a wireless access network device under the condition that the electronic device is connected with the wireless access network device;
the first counting module is used for determining a first counting value of a counter corresponding to a local clock in unit time corresponding to the first absolute time;
and a second absolute time determining module, configured to determine, according to the first count value, a second absolute time corresponding to the local clock when the electronic device is disconnected from the radio access network device.
Optionally, the second absolute time determining module is further configured to:
when determining a second absolute time corresponding to the local clock according to the first count value, determining a difference value between the first count value and a standard count value of the counter in a plurality of unit times to obtain a count difference value corresponding to each unit time;
determining a reference count difference value according to the count difference value corresponding to each unit time;
determining a third count value from the sum of the reference count difference and the standard count value;
and determining a second absolute time corresponding to the local clock according to the third counting value.
Optionally, the second absolute time determining module is further configured to:
when second absolute time corresponding to the local clock is determined according to the third counting value, counting is carried out through the counter to obtain a second counting value;
and when the second counting value reaches the third counting value, increasing the current second absolute time by the unit time to obtain the updated second absolute time.
Optionally, the second absolute time determining module is further configured to:
when a reference count difference value is determined according to the count difference value corresponding to each unit time, determining the last determined count difference value as the reference count difference value; or the like, or a combination thereof,
determining a statistical value of the count difference values corresponding to a plurality of the unit times as a reference count difference value, the statistical value including one of: mean, maximum, minimum.
Optionally, the second absolute time determining module is further configured to:
when a third counting value is determined according to the sum of the reference counting difference value and the standard counting value, determining a counting compensation value of the current temperature, wherein the counting compensation value is used for compensating a counting error in unit time corresponding to the current temperature;
and determining a third counting value according to the sum of the reference counting difference value and the standard counting value and the counting compensation value of the current temperature.
Optionally, the apparatus further comprises:
a time code output module, configured to convert the second absolute time into a time code output, where the time code includes at least one of: parallel time codes, serial time codes.
Optionally, the counter is a nanosecond counter, the unit time is 1 second, and the local clock of the electronic device is a crystal oscillator clock.
In a third aspect, the present application provides an electronic device, comprising: a memory, a processor;
a memory; a memory for storing computer-executable instructions;
the computer executable instructions, when executed by the processor, cause the electronic device to implement the method of the first aspect.
In a fourth aspect, the present application provides a computer program for implementing the method of the first aspect.
In a fifth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor of an electronic device, cause the electronic device to implement the method of the first aspect.
The application provides a clock synchronization method and equipment, wherein the method comprises the following steps: under the condition that the electronic equipment is connected with the wireless access network equipment, receiving first absolute time sent by the wireless access network equipment; determining a first count value of a counter corresponding to a local clock in unit time corresponding to a first absolute time; and under the condition that the electronic equipment is disconnected from the wireless access network equipment, determining a second absolute time corresponding to the local clock according to the first count value. The method and the device can determine a first count value of the local clock in unit time corresponding to a first absolute time issued by the wireless access network equipment when the electronic equipment is connected with the wireless access network equipment, so that the local clock is calibrated according to the first count value when the electronic equipment is disconnected with the wireless access network equipment. Because the first count value is the accurate count value determined when the electronic device is connected to the radio access network device, the accuracy of the local clock can be improved, and the accuracy of the communication time of the electronic device can be improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram illustrating an architecture of a mobile communication system to which an embodiment of the present application is applied;
fig. 2 is a schematic diagram illustrating a clock synchronization process between an electronic device and a radio access network device provided in the prior art;
FIG. 3 is a flow chart illustrating steps of a clock synchronization method provided by an embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of a clock synchronization apparatus provided in an embodiment of the present application;
fig. 5 is a block diagram illustrating an electronic device according to an embodiment of the present disclosure;
fig. 6 is a block diagram illustrating another electronic device provided in an embodiment of the present application.
Specific embodiments of the present application have been shown by way of example in the drawings and will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
Fig. 1 is a schematic diagram illustrating an architecture of a mobile communication system to which an embodiment of the present application is applied. As shown in fig. 1, the mobile communication system includes a core network device 110, a radio access network device 120, and at least one terminal device (e.g., a terminal device 130 and a terminal device 140 in fig. 1). The terminal equipment is connected with the wireless access network equipment in a wireless mode, and the wireless access network equipment is connected with the core network equipment in a wireless or wired mode. The core network device and the radio access network device may be separate physical devices, or the function of the core network device and the logical function of the radio access network device may be integrated on the same physical device, or a physical device may be integrated with a part of the function of the core network device and a part of the function of the radio access network device. The terminal equipment may be fixed or mobile. Fig. 1 is a schematic diagram, and the communication system may further include other wireless access network devices, such as a wireless relay device and a wireless backhaul device, which are not shown in fig. 1. The embodiments of the present application do not limit the number of core network devices, radio access network devices, and terminal devices included in the mobile communication system.
The radio access network device is an access device that the terminal device accesses to the mobile communication system in a wireless manner, and may be a base station (base station), an evolved NodeB (eNodeB), a Transmission Reception Point (TRP), a next generation NodeB (gNB) in a 5G mobile communication system, a base station in a future mobile communication system, or an access node in a WiFi system, and the like; the present invention may also be a module or a unit that performs part of the functions of the base station, for example, a Centralized Unit (CU) or a Distributed Unit (DU). The embodiments of the present application do not limit the specific technology and the specific device form used by the radio access network device.
In the embodiment of the present application, the apparatus for implementing the function of the radio access network device may be a radio access network device; it may also be a device, such as a chip system, capable of supporting the radio access network device to implement the function, and the device may be installed in the radio access network device or used in cooperation with the radio access network device. In the technical solution provided in the embodiment of the present application, taking a device for implementing a function of a radio access network device as an example, the device is a radio access network device, and the technical solution provided in the embodiment of the present application is described.
The Terminal device according to the embodiments of the present application may also be referred to as a Terminal, a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), or the like. The terminal device may be a mobile phone, a tablet computer, a computer with wireless transceiving function, a virtual reality terminal device, an augmented reality terminal device, a wireless terminal in industrial control, a wireless terminal in unmanned driving, a wireless terminal in telesurgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city (smart city), a wireless terminal in smart home, and the like. The embodiment of the present application does not limit the specific technology and the specific device form adopted by the terminal device.
In the process of communication between the terminal equipment and the radio access network equipment, the time of use of the terminal equipment and the radio access network equipment needs to be completely synchronous. That is, the same time as the terminal device and the radio access network device recognize is the same.
In the prior art, a clock used for communication between a radio access network device and a terminal device is generally a high-precision clock provided by a core network device through GNSS (global navigation satellite system), 1588V2, and other technologies. Specifically, referring to fig. 2, first, the radio access network device obtains a high-precision clock from the core network device; then, the radio access network equipment associates the high-precision clock with an air interface radio frame boundary to obtain a first insulation time, and sends the first insulation time to terminal equipment accessed to the radio access network equipment through an air interface signaling; and finally, after receiving the first absolute time sent by the wireless access network equipment, the terminal equipment determines a second absolute time according to the first absolute time and the air interface transmission delay, and outputs the second absolute time as communication for use.
It can be seen that the clock of the terminal device is issued by the radio access network device, so that the terminal device is required to be connected with one of the radio access network devices. In the prior art, when a terminal device is disconnected from a radio access network device, that is, the terminal device cannot be connected to any radio access network device, the terminal device cannot acquire accurate clock information from the radio access network device. At this time, the terminal device typically uses a local clock for communication.
The local clock of the terminal device is usually generated by a crystal oscillator frequency multiplication. The counter may count the oscillation of the crystal oscillator to determine the local clock from the count value. For example, if the current local clock is T1, after the crystal oscillator vibrates N times, the local clock is updated to T2, and the difference between T1 and T2 is one second, so that the local clock is continuously updated. That is, the local clock is increased by one second after every N times the crystal is oscillated.
However, the frequency of the crystal oscillator varies with use over a long period of time. That is, the crystal oscillator should vibrate N times per second under a standard condition, but its parts are aged with long-term use, resulting in the crystal oscillator vibrating N + m times per second. Therefore, the accuracy of the local clock is poor, and the accuracy of the time used by the terminal device for communication is reduced.
In order to solve the above problem, in the embodiment of the present application, when the electronic device is connected to a radio access network device, a first count value of a local clock in a unit time corresponding to a first absolute time sent by the radio access network device is determined, so that when the electronic device is disconnected from the radio access network device, the local clock is calibrated according to the first count value. Therefore, the accuracy of the local clock can be improved, and the accuracy of the time used by the electronic equipment is further improved.
These several specific embodiments may be combined with each other below, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 3 is a flowchart illustrating steps of a clock synchronization method provided by an embodiment of the present application, and is applied to an electronic device, where the electronic device is the aforementioned terminal device or communication module. Referring to fig. 3, the clock synchronization method includes S101 to S103.
S101: in the case that the electronic device is connected with a wireless access network device, a first absolute time transmitted by the wireless access network device is received.
The first absolute time is obtained after the radio access device associates a high-precision clock sent by the core network device with an air interface radio frame boundary, and is accurate time.
S102: and determining a first count value of a counter corresponding to the local clock in unit time corresponding to the first absolute time.
Wherein the local clock is a clock provided by a clock source of the electronic device. The local clock is clocked by the oscillation of a crystal oscillator provided in the electronic device, and thus the local clock may also be referred to as a crystal oscillator clock. The vibration frequency of the crystal oscillator in each second has a certain corresponding relation with the nanosecond counter. Typically, the number of local clock oscillations is much smaller than the count of the nanosecond counter.
The counter can be various types of counters with various accuracies. In view of the accuracy requirements, nanosecond counters are usually employed. When the unit time is 1 second, the count value of the nanosecond counter per unit time is 10 9 That is, the standard count value of the nanosecond counter is 10 9
It should be noted that, in addition to performing S102, the electronic device according to the embodiment of the present application may further determine a second absolute time according to the first absolute time sent by the radio access network device, so as to perform communication according to the second absolute time.
S103: and under the condition that the electronic equipment is disconnected from the wireless access network equipment, determining a second absolute time corresponding to the local clock according to the first count value.
Specifically, in a case that the electronic device is disconnected from the radio access network device, the electronic device may count through the counter to obtain a second count value, and increase the current second absolute time by a unit time, for example, by one second, when the second count value reaches the first count value; and when the second count value does not reach the first count value, continuing to count.
When only the count value corresponding to one unit time is counted, the count value corresponding to the unit time may be used as the second count value.
When the count values corresponding to the plurality of unit times are counted, the count value corresponding to the last unit time may be determined as the second count value, or the second absolute time may be determined according to a difference between the count value and the standard count value.
The determining the second absolute time according to the difference between the count value and the standard count value may specifically include: firstly, determining the difference value between a first count value and a standard count value of a counter in a plurality of unit times to obtain the corresponding count difference value of each unit time; then, determining a reference count difference value according to the count difference value corresponding to each unit time; then, determining a third count value according to the sum of the reference count difference value and the standard count value; and finally, determining a second absolute time corresponding to the local clock according to the third counting value.
The process of determining the count difference is illustrated below.
After a first count value N1 is obtained in a first unit time T1, calculating a difference value between the N1 and a standard count value SN to obtain a count difference value MN1 corresponding to the T1; after a second count value N2 is obtained in a second unit time T2, calculating the difference value between the N2 and the standard count value SN to obtain a count difference value MN2 corresponding to the T2; and after a second counting value N3 is obtained in the third unit time T3, calculating the difference value between the N3 and the standard counting value SN to obtain a counting difference value MN3 corresponding to the T3.
T1, T2, and T3 may be continuous three unit times or discontinuous unit times, which is not limited in the embodiment of the present application.
After the above MN1, MN2, and MN3 are obtained, a reference count difference value may be determined from MN1, MN2, and MN3. The method of determining the reference count difference may be multiple.
First, a reference count difference is randomly selected from a plurality of count differences, that is, any one of MN1, MN2, and MN3 is determined as the reference count difference.
Second, the last determined count difference is determined as a reference count difference, that is, the count difference MN3 corresponding to the last unit time T3 is determined as a reference count difference.
In a third aspect, a statistical value of the count difference values corresponding to the plurality of unit times is determined as a reference count difference value, where the statistical value includes one of: mean, maximum, minimum. That is, the average value, or the maximum value, or the minimum value of MN1, MN2, and MN3 is determined as the reference count difference value.
After the reference count difference is obtained, the sum of the reference count difference and the standard count value may be used as a third count value, and the error caused by the temperature may be considered to perform temperature compensation on the local clock at the same time, so as to obtain the third count value.
The process of temperature compensation may include: firstly, determining a counting compensation value of the current temperature, wherein the counting compensation value is used for compensating a counting error in unit time corresponding to the current temperature; and determining a third counting value according to the sum of the reference counting difference value and the standard counting value and the counting compensation value of the current temperature.
Specifically, when the count compensation value is used to indicate the increase amount of the current temperature to the count value, the sum of the reference count difference value and the standard count value, and the sum of the count compensation value of the current temperature are determined as the third count value. When the count compensation value is used to indicate a decrease amount of the current temperature from the count value, a difference of the count compensation value of the current temperature, which is a sum of the reference count difference value and the standard count value, is determined as a third count value.
After obtaining the third count value, the third count value may be used to determine a second absolute time corresponding to the local clock. Specifically, first, a counter counts to obtain a second count value; then, when the second count value reaches a third count value, the current second absolute time is increased by the unit time to obtain an updated second absolute time.
After obtaining the second absolute time, the electronic device may further convert the second absolute time into a time code output, where the time code includes at least one of: parallel time codes, serial time codes.
It will be appreciated that the time code output is used to communicate between the electronic device and the radio access network device or to provide the user with accurate time.
Correspondingly, corresponding to the clock synchronization method shown in fig. 3, an embodiment of the present application further provides a clock synchronization apparatus, which is applied to an electronic device, where the electronic device is the aforementioned terminal device or communication module. Fig. 4 is a block diagram illustrating a structure of a clock synchronization apparatus according to an embodiment of the present application. Referring to fig. 4, the clock synchronization apparatus 200 includes:
a first absolute time receiving module 201, configured to receive a first absolute time sent by a radio access network device when the electronic device is connected to the radio access network device.
The first counting module 202 is configured to determine a first count value of a counter corresponding to the local clock in a unit time corresponding to the first absolute time.
A second absolute time determining module 203, configured to determine, according to the first count value, a second absolute time corresponding to the local clock when the electronic device is disconnected from the radio access network device.
Optionally, the second absolute time determining module 203 is further configured to:
when second absolute time corresponding to the local clock is determined according to the first count value, determining the difference value between the first count value and a standard count value of the counter in a plurality of unit times to obtain a count difference value corresponding to each unit time; determining a reference count difference value according to the count difference value corresponding to each unit time; determining a third count value from the sum of the reference count difference and the standard count value; and determining a second absolute time corresponding to the local clock according to the third counting value.
Optionally, the second absolute time determining module 203 is further configured to:
when second absolute time corresponding to the local clock is determined according to the third count value, counting is carried out through the counter to obtain a second count value; and when the second counting value reaches the third counting value, increasing the current second absolute time by the unit time to obtain the updated second absolute time.
Optionally, the second absolute time determining module 203 is further configured to:
when a reference count difference value is determined according to the count difference value corresponding to each unit time, determining the last determined count difference value as the reference count difference value; or, determining a statistical value of the count difference values corresponding to a plurality of the unit times as a reference count difference value, wherein the statistical value includes one of: mean, maximum, minimum.
Optionally, the second absolute time determining module 203 is further configured to:
when a third counting value is determined according to the sum of the reference counting difference value and the standard counting value, determining a counting compensation value of the current temperature, wherein the counting compensation value is used for compensating a counting error in unit time corresponding to the current temperature; and determining a third counting value according to the sum of the reference counting difference value and the standard counting value and the counting compensation value of the current temperature.
Optionally, the apparatus further comprises:
a time code output module, configured to convert the second absolute time into a time code output, where the time code includes at least one of: parallel time codes, serial time codes.
Optionally, the counter is a nanosecond counter, the unit time is 1 second, and the local clock of the electronic device is a crystal oscillator clock.
The embodiments of the clock synchronization apparatus are apparatus embodiments corresponding to the method embodiments, and have the same technical effects as the method embodiments, and the detailed description may refer to the detailed description of the method embodiments, which is not repeated herein.
The electronic device may be referred to as an electronic device. Fig. 5 is a block diagram illustrating a structure of an electronic device according to an embodiment of the present application. The electronic device 300 comprises a processor 301 and a memory 302 for storing computer-executable instructions of the processor 301, which when executed by the processor 301, cause the electronic device 300 to implement the aforementioned clock synchronization method.
In addition, the electronic device further includes a receiver 303 and a transmitter 304, the receiver 303 is configured to receive information from the remaining apparatuses or devices and forward the information to the processor 301, and the transmitter 304 is configured to transmit the information to the remaining apparatuses or devices.
Further, fig. 6 exemplarily shows a block diagram of another electronic device provided in the embodiment of the present application, where the electronic device 900 may be a terminal device. Among them, the terminal Device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a car terminal (e.g., car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the electronic device 900 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 901, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage device 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are also stored. The processing apparatus 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
Generally, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic apparatus 900 to communicate with other apparatuses wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 900 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. The computer program, when executed by the processing apparatus 901, performs the above-described functions defined in the methods of the embodiments of the present application.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may be separate and not incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first obtaining unit may also be described as a "unit obtaining at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The embodiment of the application also provides a computer program, and the computer program is used for realizing the clock synchronization method.
The embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement the aforementioned clock synchronization method.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. A clock synchronization method applied to an electronic device includes:
under the condition that the electronic equipment is connected with a wireless access network device, receiving a first absolute time sent by the wireless access network device;
determining a first count value of a counter corresponding to a local clock in unit time corresponding to the first absolute time;
and under the condition that the electronic equipment is disconnected from the wireless access network equipment, determining a second absolute time corresponding to the local clock according to the first count value.
2. The method of claim 1, wherein determining the second absolute time corresponding to the local clock according to the first count value comprises:
determining the difference value between the first count value and a standard count value of the counter in a plurality of unit times to obtain a count difference value corresponding to each unit time;
determining a reference count difference value according to the count difference value corresponding to each unit time;
determining a third count value from the sum of the reference count difference and the standard count value;
and determining a second absolute time corresponding to the local clock according to the third counting value.
3. The method of claim 2, wherein determining a second absolute time corresponding to the local clock based on the third count value comprises:
counting by the counter to obtain a second count value;
and when the second counting value reaches the third counting value, increasing the current second absolute time by the unit time to obtain the updated second absolute time.
4. The method of claim 2, wherein said determining a reference count difference from said count difference for each of said units of time comprises:
determining the last determined count difference as the reference count difference; or the like, or, alternatively,
determining a statistical value of the count difference values corresponding to a plurality of the unit times as a reference count difference value, the statistical value including one of: mean, maximum, minimum.
5. The method of claim 2, wherein determining a third count value based on a sum of the reference count difference and the standard count value comprises:
determining a counting compensation value of the current temperature, wherein the counting compensation value is used for compensating a counting error in unit time corresponding to the current temperature;
and determining a third counting value according to the sum of the reference counting difference value and the standard counting value and the counting compensation value of the current temperature.
6. The method of any of claims 1 to 5, further comprising:
converting the second absolute time to a time code output, the time code including at least one of: parallel time codes, serial time codes.
7. The method according to any one of claims 1 to 5, wherein the counter is a nanosecond counter, the unit time is 1 second, and the local clock of the electronic device is a crystal clock.
8. A clock synchronization device applied to an electronic device includes:
the first absolute time receiving module is used for receiving a first absolute time sent by a wireless access network device under the condition that the electronic device is connected with the wireless access network device;
the first counting module is used for determining a first counting value of a counter corresponding to a local clock in unit time corresponding to the first absolute time;
and a second absolute time determining module, configured to determine, according to the first count value, a second absolute time corresponding to the local clock when the electronic device is disconnected from the radio access network device.
9. An electronic device, comprising: a memory, a processor;
a memory; a memory for storing computer-executable instructions;
the computer executable instructions, when executed by the processor, cause the electronic device to implement the method of any of claims 1 to 7.
10. A computer program for implementing the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having computer-executable instructions stored therein, wherein the computer-executable instructions in the computer-readable storage medium, when executed by a processor of an electronic device, cause the electronic device to implement the method of any one of claims 1 to 7.
CN202111060843.7A 2021-09-10 2021-09-10 Clock synchronization method and equipment Pending CN115802471A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111060843.7A CN115802471A (en) 2021-09-10 2021-09-10 Clock synchronization method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111060843.7A CN115802471A (en) 2021-09-10 2021-09-10 Clock synchronization method and equipment

Publications (1)

Publication Number Publication Date
CN115802471A true CN115802471A (en) 2023-03-14

Family

ID=85417060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111060843.7A Pending CN115802471A (en) 2021-09-10 2021-09-10 Clock synchronization method and equipment

Country Status (1)

Country Link
CN (1) CN115802471A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251022A (en) * 2023-11-17 2023-12-19 苏州元脑智能科技有限公司 Method and device for acquiring absolute time, storage medium and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251022A (en) * 2023-11-17 2023-12-19 苏州元脑智能科技有限公司 Method and device for acquiring absolute time, storage medium and electronic device
CN117251022B (en) * 2023-11-17 2024-03-12 苏州元脑智能科技有限公司 Method and device for acquiring absolute time, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN111475298B (en) Task processing method, device, equipment and storage medium
CN110677818A (en) Positioning method, device, system, computing equipment and medium
CN107027164A (en) A kind of synchronous method and device
CN115640285B (en) Power abnormality information transmission method, device, electronic equipment and medium
CN111679990A (en) Test data generation method and device, readable medium and electronic equipment
CN115802471A (en) Clock synchronization method and equipment
CN110879729A (en) Channel configuration method and device for live broadcast room, readable medium and electronic equipment
EP4120754A1 (en) Clock calibration method and apparatus
CN113765613A (en) Dynamic double-node time-frequency synchronization method, device, equipment and storage medium
US10136261B2 (en) Method and apparatus to transmit and receive data based on location
CN111262907B (en) Service instance access method and device and electronic equipment
CN112954056A (en) Monitoring data processing method and device, electronic equipment and storage medium
CN111798251A (en) Verification method and device of house source data and electronic equipment
CN112590929A (en) Correction method, apparatus, electronic device, and medium for steering wheel of autonomous vehicle
CN113691339B (en) Clock synchronization method, device, equipment and storage medium
WO2021097680A1 (en) Positioning method and apparatus
CN110366239B (en) Positioning method and device integrating signal intensity and storage medium
CN111314021A (en) Data transmission method and device, electronic equipment and computer readable storage medium
CN114731608A (en) Positioning request processing method, device and system
CN114051276B (en) Serial time code time service method, system and electronic equipment
CN116744439B (en) Positioning system and method
CN110715720B (en) Terminal vibration method, terminal and storage medium
CN111625707B (en) Recommendation response method, device, medium and equipment
CN116703262B (en) Distribution resource adjustment method, distribution resource adjustment device, electronic equipment and computer readable medium
CN111106890B (en) Method and equipment for time synchronization

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