CN114124273B - Time acquisition method, related device and equipment and computer readable storage medium - Google Patents

Time acquisition method, related device and equipment and computer readable storage medium Download PDF

Info

Publication number
CN114124273B
CN114124273B CN202010876737.5A CN202010876737A CN114124273B CN 114124273 B CN114124273 B CN 114124273B CN 202010876737 A CN202010876737 A CN 202010876737A CN 114124273 B CN114124273 B CN 114124273B
Authority
CN
China
Prior art keywords
time
system frame
frame number
terminal equipment
length
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.)
Active
Application number
CN202010876737.5A
Other languages
Chinese (zh)
Other versions
CN114124273A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010876737.5A priority Critical patent/CN114124273B/en
Publication of CN114124273A publication Critical patent/CN114124273A/en
Application granted granted Critical
Publication of CN114124273B publication Critical patent/CN114124273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others
    • 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

Abstract

The application provides a time acquisition method, a related device and equipment and a computer readable storage medium. The method comprises the following steps: the terminal equipment acquires time as local time of the terminal equipment through a mobile network or other modes, and when the terminal equipment receives a time acquisition instruction, the effective system frame number sent from a base station is analyzed to obtain high-precision first time F corresponding to the effective system frame number. And the terminal equipment updates the local time of the terminal equipment by using the first time F, and the precision of the first time F is higher than that of the original local time of the terminal equipment. Therefore, the time precision of the terminal equipment is greatly improved by the method for acquiring the time.

Description

Time acquisition method, related device and equipment and computer readable storage medium
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a time obtaining method, a related device and equipment and a computer readable storage medium.
Background
With The application of intelligent terminals such as smart phones becoming more and more extensive, the intelligent terminals have become The center of The Internet of Things (IOT), the time precision of The existing terminal equipment cannot meet The user requirements, some special commemorative moments need higher time precision, and The interconnection and interaction of more equipment in The future also need higher-precision time information support.
At present, two main time service modes of the intelligent terminal are provided. One is that the intelligent terminal obtains Time through a mobile Network, such as through a Time synchronization Protocol (NTP), a Network identifier and a Time Zone (NITZ), and so on. Taking the example that the intelligent terminal obtains time through the time synchronization protocol NTP, the time synchronization server provides time reference for all terminal devices in the network through the network time protocol. However, since the time acquired by the terminal device needs to pass through paths such as a base station, the internet, a node, an NTP server, and the like, the number of paths is large, and the accuracy of the acquired time is not high, and the time acquired by the terminal device has an error of 1 to 2s compared with the coordinated universal time UTC by the way of acquiring the time through the mobile network.
Another time service method is to provide time service via a Global positioning System (GNSS), and a mobile phone terminal interacts with a Satellite via a built-in GNSS time service module, so as to obtain time with higher accuracy. The terminal equipment is required to be internally provided with a corresponding GNSS time service module and can be interacted with a satellite to acquire time from the GNSS. In addition, because of the problem of GPS signal occlusion, it is necessary to acquire accurate time in an open outdoor area. Therefore, the intelligent terminal has limited application scenarios in a way of acquiring time through the GNSS.
Disclosure of Invention
The technical problem to be solved in the embodiments of the present application is to provide a time obtaining method, a related apparatus, a device, and a computer-readable storage medium, which can effectively improve time precision of a terminal device and have a wide application range.
In a first aspect, an embodiment of the present application provides a method for time acquisition, which is applied to a terminal device and may include:
the terminal equipment receives a time acquisition instruction;
the terminal equipment responds to the time acquisition instruction and obtains first time F by analyzing the effective system frame number sent by the base station;
and the terminal equipment updates the local time to the first time F.
In the embodiment of the application, the terminal equipment receives the effective system frame number sent from the base station, and the first time F is calculated through a relevant time transfer function by combining the effective system frame number and the local time of the terminal equipment. The precision of the obtained first time F is higher than that of the terminal equipment which acquires the time through the mobile network (the difference between the time acquired by the terminal equipment through the mobile network and the time of the coordinated world is generally 1-2 seconds), and the time precision of the terminal equipment is improved after the first time F is updated to the local time. Due to the fact that time service through a GNSS is not needed, the technical problem that the application scene is limited in a GNSS time obtaining mode is solved, and the method is wide in application scene.
In a possible implementation manner, the obtaining the first time F by analyzing an effective system frame number sent by a base station includes:
obtaining a second time F1 based on the absolute time and the number of times of circulation of a system frame number from the absolute time to the local time of the terminal equipment; obtaining a third time F2 based on the length of a system frame and the effective system frame number sent by the base station;
and combining the second time F1 and the third time F2 to obtain the first time F.
In the embodiment of the application, the second time F1 represents a time corresponding to a system frame number that circulates X times from the absolute time to the local time of the terminal device; the third time F2 represents a duration corresponding to the effective system frame number received by the terminal device; the first time F represents the precise time corresponding to the obtained system frame number based on the second time F1 and the third time F2 (the F time precision is in millisecond level). The local time of the terminal device refers to the time before the terminal device is not updated, and the manner of acquiring the local time by the terminal device can be realized in various manners such as a mobile network and a GNSS.
In a possible implementation manner, the combining the second time F1 and the third time F2 to obtain the first time F includes:
obtaining the first time F according to a formula F = F1+ F2;
wherein F1= S + X h z; f2= Framenumber z;
wherein S is absolute time, and S is taken as unit of millisecond; x is the number of times of circulation of the system frame number from the absolute time to the local time of the terminal equipment; h is the frame number of the system frame number circulating once; z is the length of one system frame, and z is in milliseconds; framenumber is the effective system frame number.
In the embodiment of the present application, the absolute time represented by S is a preconfigured time reference, and this time reference is preset in the embodiment of the present application as 1986/01/01 00. Calculating the corresponding time F1 from the absolute time to the local time of the terminal equipment and after the system frame number circulates X times according to the absolute time S, the number X of times of the system frame number circulation and the length of the system frame; calculating the duration F2 corresponding to the effective system frame number received by the terminal equipment according to the effective system frame number received by the terminal equipment and the system frame length; and then combining the F1 and the F2 to obtain the accurate time corresponding to the system frame number (the accuracy of the F time is at millisecond level). In this embodiment, the time precision analyzed by the effective system frame number is the same as the length of the system frame.
In a possible implementation manner, the combining the second time F1 and the third time F2 to obtain the first time F includes:
obtaining the first time F according to a formula F = F1+ F2+ F3;
wherein F1= S + X h z; f2= Framenumber z; f3= subframe number y;
wherein S is absolute time, and S is taken as unit of millisecond; x is the number of times of circulation of the system frame number from the absolute time to the local time of the terminal equipment; h is the frame number of the system frame number circulating once; z is the length corresponding to one system frame, and the z is in milliseconds; framenumber is the effective system frame number; f3 is a fourth time F3 obtained based on the length of one system subframe and the effective system subframe number sent by the base station; subframe number is the effective system subframe number; y is the length of the system subframe, and the y is in milliseconds.
In the embodiment of the present application, the absolute time represented by S is a preconfigured time reference, and this time reference is preset in the embodiment of the present application as 1986/01/01 00. Calculating the corresponding time F1 from the absolute time to the local time of the terminal equipment and the system frame number after the system frame number circulates X times according to the absolute time S, the local time of the terminal equipment from the absolute time, the number X of times of system frame number circulation and the length of the system frame; calculating the duration F2 corresponding to the effective system frame number received by the terminal equipment according to the effective system frame number received by the terminal equipment and the system frame length; calculating the duration F3 corresponding to the effective system subframe number according to the system subframe number and the subframe length; and then combining the F1, the F2 and the F3 to obtain the accurate time corresponding to the system frame number (the F time accuracy is at millisecond level). In this embodiment, the time precision analyzed by the effective system frame number is the same as the subframe length.
In one possible implementation manner, the number X of times that the system frame number cycles from the absolute time to the local time of the terminal device includes:
X=floor{(C-Framenumber*10)/(h*z)};
wherein C is the time length from the absolute time to the adjustment time of the terminal equipment, and C is the unit of millisecond; the adjusting time is the time obtained by adding a first time length k to the local time of the terminal equipment; the first time length k is an error range between the local time of the terminal equipment and the first time F; h is the frame number of the system frame number circulating once; the z is a length corresponding to one system frame, and the z is in milliseconds.
In the embodiment of the present application, a first duration k is an error range between the local time of the terminal device and the first time F, and the first duration k is generally 2000 milliseconds; the calculation formula of the time length C of the adjustment time is C = N + k-S, N is local time obtained by the terminal equipment through a mobile network, and N is in milliseconds; s is an absolute time, which is a preconfigured time reference, and is expressed in milliseconds.
In one possible implementation, the system subframe number corresponds to a subframe length derived based on a subcarrier spacing, and is cyclically incremented at a fixed period.
In the embodiment of the application, the subframe length of a system subframe corresponds to a subframe length, the subframe length is related to the interval of subcarriers, in a 5G NR system, the interval of subcarriers can be 3.75KHz, 15KHz, 30KHz, 60KHz, 120KHz …, the corresponding subframe lengths are 4ms, 1ms, 0.5ms, 0.25ms, 0.125ms …, the interval of subcarriers is different, the subframe lengths corresponding to subframe numbers are also different, the time precision analyzed by an effective system frame number is the same as the subframe length, for example, the length of a system frame is 10ms, when the interval of subcarriers is 30KHz, the corresponding subframe length is 0.5ms per frame, one system frame has 20 subframes (10 divided by 0.5), and the system subframe number repeatedly increases by taking 20 frames as a period. In this embodiment, the time precision analyzed by the effective system frame number is the same as the subframe length, so the precision of the first time F analyzed by the effective system frame number reaches 0.5ms.
In a possible implementation manner, the terminal device determines whether the storage duration of the received system frame number exceeds a time threshold, and the valid system frame number is the system frame number whose storage duration does not exceed the time threshold.
In the embodiment of the application, the terminal equipment can perform sexual screening on the received system frame number by setting the time threshold so that the terminal equipment can select the most appropriate system frame number for analysis; for invalid sfn, the terminal device discards it and waits for the next valid sfn.
In a possible implementation manner, the receiving, by the terminal device, the time obtaining instruction includes: and the terminal equipment receives the time acquisition instruction according to a period or at least one preset moment.
According to the embodiment of the application, the terminal equipment can be provided with a timing mechanism and one or more fixed moments, the terminal equipment analyzes the system frame number sent from the base station at the set fixed moments, the fixed moments can be set by a user, and the system setting of the terminal equipment can also be carried out before the terminal equipment leaves a factory. The terminal device may also realize the periodic analysis of the system frame number by the terminal device by setting a time interval for analyzing the system frame number, where the time interval may be set by the user, or may be set by the terminal device system before the terminal device leaves the factory. Before analyzing the system frame number, the terminal device receives a time acquisition instruction as a touch signal to trigger the terminal device to analyze the system frame number. At the moment when the terminal device analyzes the system frame number, the terminal device receives the time acquisition instruction and then triggers the terminal device to analyze the system frame number. In this embodiment, a trigger condition of specific time is provided for the terminal device to analyze the system frame number and subframe number thereof sent by the base station, so that the terminal device can ensure time accuracy under the condition of low energy consumption.
In a possible implementation manner, the receiving, by the terminal device, the time obtaining instruction includes: the terminal equipment receives an input touch signal.
According to the embodiment of the application, a sensor of the terminal equipment receives a time updating control key clicked by a user on a screen of the terminal equipment, namely a touch signal is received, and the received touch signal is the time obtaining instruction. And after receiving the touch signal, the terminal equipment analyzes the effective system frame number to obtain the first time F.
In a second aspect, an embodiment of the present application provides a time obtaining apparatus, which may include: a time acquisition instruction receiving unit, configured to receive a time acquisition instruction before the terminal device analyzes the effective system frame number; a system frame number analyzing unit, configured to analyze the effective system frame number to a first time F by the terminal device;
and the time updating unit is used for updating the local time of the terminal equipment to the first time F.
In a possible implementation manner, the time obtaining apparatus further includes: and the system frame number judging unit is used for judging whether the storage duration of the received system frame number exceeds a time threshold, and the effective system frame number is the system frame number of which the storage duration does not exceed the time threshold.
In a possible implementation manner, the system frame number parsing unit includes:
the first analysis unit is used for obtaining a second time F1 based on the absolute time, the number of times of circulation of a system frame number from the absolute time to the local time of the terminal equipment;
a second parsing unit, configured to obtain a third time F2 based on a length of a system frame and the effective system frame number sent by the base station;
and the combining unit is used for combining the second time F1 and the third time F2 to obtain the first time.
In a possible implementation manner, the combining unit is specifically configured to:
obtaining the first time F according to a formula F = F1+ F2;
wherein F1= S + X h z; f2= Framenumber z;
wherein S is absolute time, and the S is in milliseconds; x is the number of times of circulation of the system frame number from the absolute time to the local time of the terminal equipment; h is the frame number of the system frame number circulating once; z is the length of one system frame, and z is in milliseconds; framenumber is the effective system frame number.
In a possible implementation manner, the combining unit is specifically configured to:
obtaining the first time F according to a formula F = F1+ F2+ F3;
wherein F1= S + X h z; f2= Framenumber z; f3= subframe number y;
wherein S is absolute time, and S is taken as unit of millisecond; x is the number of times of circulation of the system frame number from the absolute time to the local time of the terminal equipment; h is the frame number of the system frame number circulating once; the z is the length corresponding to one system frame, and the z is taken as a unit of millisecond; framenumber is the effective system frame number; f3 is based on the length of a system subframe and the received effective system subframe number sent by the base station, and a fourth time F3 is obtained; subframe number is the effective system subframe number; y is the length of the system subframe, and the y is in milliseconds.
In a possible implementation manner, the time obtaining apparatus further includes: a system frame number cycle number calculating unit, configured to calculate a number X of times a system frame number cycles from the absolute time to the local time of the terminal device, including:
X=floor{(C-Framenumber*10)/(h*z)};
wherein h is the frame number of the system frame number circulating once; the z is the length corresponding to one system frame, and the z is taken as a unit of millisecond; c is the time length from the absolute time to the adjustment time of the terminal equipment, and C is in milliseconds; the adjusting time is the time obtained by adding a first time length k to the local time of the terminal equipment; the first time length k is an error range between the local time of the terminal device and the first time F.
In a possible implementation manner, the time obtaining apparatus further includes: and the trigger unit is used for clicking a time updating function control key on a screen of the terminal equipment by a user, a sensor on the terminal equipment receives a touch signal of the user and sends the touch signal to a system frame number analysis unit of the time acquisition device as a time acquisition instruction, and the system frame number analysis unit can analyze the effective system frame number and the subframe number thereof after receiving the time acquisition instruction to obtain the first time F.
In a third aspect, an embodiment of the present application provides a terminal device, which may include: a processor and a memory; the memory is configured to store a program code, and the processor is configured to call the program code stored in the memory and execute the time obtaining method in the first aspect and various possible implementation manners.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the time obtaining method in the first aspect and various possible implementation manners thereof are implemented.
In a fifth aspect, this embodiment provides a computer program, where the computer program includes instructions, and when the computer program is executed by a computer, the terminal device may execute the procedures executed by the terminal device in the first aspect and various possible implementations thereof.
Drawings
The drawings used in the embodiments of the present application are described below.
Fig. 1 is a schematic diagram of a terminal device time acquisition system architecture according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a time acquisition method provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a system frame structure according to an embodiment of the present application;
fig. 4 is a local time value range diagram of a terminal device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a time acquisition apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a system frame number parsing unit of a time obtaining apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art can explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not necessarily for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process may comprise a sequence of steps or elements, or may alternatively comprise steps or elements not listed, or may alternatively comprise other steps or elements inherent to such process, method, article, or apparatus.
Only some, but not all, of the material relevant to the present application is shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, subprograms, and the like.
As used in this specification, the terms "component," "module," "system," "unit," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a unit may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or distributed between two or more computers. In addition, these units may execute from various computer readable media having various data structures stored thereon. The elements may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., from a second element interacting with another element in a local system, distributed system, and/or across a network.
First, some terms in the present application are explained so as to be understood by those skilled in the art.
(1) Coordinated Universal Time (UTC) is a Time metering system that is as close in Time to world Time as possible based on atomic Time-seconds. The set of time systems is used in many standards for the internet and world wide web, for example, the network time protocol is one way to coordinate the use of the world time in the internet.
(2) Network Time Protocol (NTP) is a Protocol used to synchronize the Time of terminal devices. The network time protocol may enable the terminal device to time synchronize its clock sources. In order to adapt to the hierarchical structure of the network, the network time protocol adopts a hierarchical time distribution model, and comprises a master time server, slave time servers and transmission paths among nodes (including the slave time servers and terminal equipment). The master time server is a high-precision synchronous clock source, and the slave time server obtains synchronous time through the master time server. Time propagates in the hierarchy of time servers, with all servers grouped into different Stratun (tiers) by distance from the external UTC source, stratun-1 at the top with external UTC access, stratun-2 from Stratun-1 time, stratun-3 from Stratun-2 time, and so on. However, the total number of Stratun layers is limited to 15 layers, all time synchronization servers are connected with each other in a logic step type framework, and a main time server is located at a Stratun-1 layer and is the basis of the whole system.
(3) The New 5G NR (New Radio, NR) air interface system is a global 5G standard designed based on a brand New air interface of OFDM and is also a very important cellular mobile technology basis of the next generation, and the 5G technology can realize ultra-low time delay and high reliability. NR relates to a new wireless standard based on Orthogonal Frequency Division Multiplexing (OFDM). OFDM refers to a digital multi-carrier modulation method. As 3GPP adopts this standard, the term NR is used to become another substitute for 5G.
In order to facilitate understanding of the embodiments of the present application, a description will be given below of one of the system architectures on which the embodiments of the present application are based. Referring to fig. 1, fig. 1 is a schematic diagram of a system architecture for acquiring time of a terminal device according to an embodiment of the present disclosure. The system architecture may include a terminal device (for example, a smartphone in fig. 1), a base station, a global navigation satellite system GNSS (for example, GPS in fig. 1), and a device related to network time acquisition (for example, a time synchronization server NTP server in fig. 1). The number of the terminal devices may be one or more (only one is listed in fig. 1), and the terminal devices may access the network by communicating with the base station. The built-in time service module of the base station can acquire high-precision reference time through a Global Navigation Satellite System (GNSS). For example, each user has a smart phone capable of communicating with a base station, the smart phone of the user communicates with the base station, the base station accesses the internet, the smart phone analyzes the address of the NTP server of the time synchronization server, the NTP server provides time for all smart phones accessing the network based on the network time protocol, and the smart phone takes the acquired network time as local time. The flow of the smart phone acquiring the high-precision time is as follows:
the base station acquires high-precision time from the GPS satellite through a built-in time service module and sends a system frame number to the smart phone, wherein the system frame number carries time information acquired by the base station.
The smart phone receives a time acquisition instruction according to a time updating function control key clicked by a user on a screen of the smart phone; or periodically receiving a time acquisition instruction according to a preset frequency; or receive time acquisition instructions at one or more fixed times.
After receiving the time acquisition instruction, the smart phone analyzes the system frame number sent by the base station when communicating with the base station to obtain high-precision time, and updates the high-precision time to the local time of the smart phone.
It should be noted that the terminal device in the embodiment of the present application may include, but is not limited to, a mobile phone, a tablet Computer, a desktop Computer, a laptop Computer, a notebook Computer, an Ultra-mobile Personal Computer (UMPC), a handheld Computer, a netbook, a Personal Digital Assistant (PDA), a wearable electronic device, a virtual reality device, an in-vehicle device, and other electronic devices.
By the method for acquiring the time of the smart phone, the smart phone can acquire high-precision time. The traditional terminal equipment acquires time through a mobile network and a time network protocol, the path through which clock information passes is long, in addition, factors such as network delay and the like are considered, and the time acquired by the terminal equipment is often not high in precision (generally, the difference between the time acquired by the terminal equipment and UTC is about 1-2 s). According to the method for acquiring the time by the smart phone, the smart phone is directly communicated with the base station, the transmission path of the system frame number is few, and the high-precision time acquired by the base station through a high-precision clock source such as a global satellite navigation system is directly acquired by analyzing the system frame number sent by the base station to the terminal equipment, so that the time precision (the precision is ms level) of the smart phone is improved.
Referring to fig. 2, fig. 2 is a flowchart of a time obtaining method according to an embodiment of the present disclosure. As shown in fig. 2, the time acquisition method includes the following steps.
Step S201: and the terminal equipment acquires time through a built-in time service module and takes the time as the local time N of the terminal equipment.
Specifically, the time service module built in the terminal device may enable the terminal device to obtain time through a mobile network, or may enable the terminal device to obtain time from other time sources through other manners. The terminal device obtains the time through the mobile network by using a network time protocol, a network identifier, a time zone mechanism, and the like.
The terminal device can acquire the time through the mobile network under the following conditions: the method comprises the steps of obtaining time after the terminal equipment is started, obtaining the periodic time of the terminal equipment according to a preset frequency of a system, and obtaining the time of the terminal equipment at a preset moment. The terminal equipment firstly communicates with the base station, and the base station is connected with the core network, so that the terminal equipment can access the internet through communicating with the base station. The time synchronization server is also accessed to the internet, and acquires coordinated universal time UTC from a satellite or other high-precision clock sources through a built-in time service module. The terminal equipment analyzes the address of the time server after accessing the internet, then the time synchronization server provides a time reference for the terminal equipment which has accessed the network based on the network time protocol NTP, the terminal equipment obtains the time from the time synchronization server, and the obtained time is used as the local time of the terminal equipment (the precision error is less than 2 s).
The terminal device may be a User Equipment (UE), an access terminal, a UE unit, a UE station, a mobile station, a remote terminal, a mobile device, a UE terminal, a wireless communication device, a UE agent, or a UE apparatus. An access terminal may be a cellular telephone, a cordless telephone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a Wireless enabled handheld device, a computer device or other processing device connected to a Wireless modem, a vehicle mounted device, a wearable device, a terminal in a 5G Network or a terminal in a future evolved Public Land Network (PLMN), etc.
Step S202: the base station acquires high-precision time X1 from a Global Navigation Satellite System (GNSS) or other high-precision time sources through a built-in time service module.
In this embodiment, a base station obtains a high-precision coordinated universal time UTC from a global positioning system GPS as an example.
Specifically, the GPS provides time service covering the whole world by utilizing a high-precision atomic clock carried by a GPS satellite to generate a reference signal and a time standard, and the time service is provided by the GPS to the base station, wherein the time service precision is as high as 20 billionth of a second. The GPS time service system mainly utilizes the characteristic of GPS accurate time synchronization to realize the unified time synchronization of the base stations. A GPS receiver in a built-in time service module of a base station can simultaneously receive 4-8 satellite signals in the visual field range of the GPS receiver at any time, and extracts and outputs two time signals after decoding and processing, wherein the two time signals comprise:
(1) The Pulse Per Second (PSS) of the Pulse signal with the time interval of 1s has the synchronization error of the Pulse leading edge and the international standard time (Greenwich mean time) not exceeding 1 mu s. The pulse signals PPS are sent one by one in one second, the rising edge of the pulse signals PPS is used for representing the time of the whole second, the precision can reach ns level, and no accumulated error exists.
(2) And the international standard time and date code corresponding to the front edge of the PPS pulse output by the serial port.
Step S203: the base station communicates with the terminal equipment, and the information sent to the terminal equipment by the base station comprises a system frame, a system frame number and a subframe number of the system frame.
Specifically, the structure and related features of the system frame number are shown in fig. 3. The system frame number sent by the base station is repeatedly increased by taking 1024 frames as a period according to an absolute time, namely: the system frame numbers are incremented cyclically in the order of 0,1,2 … … 1023. The length of the system frame corresponding to each system frame number is 10ms, and then the period of the system frame number cycle is 10240ms. Wherein, the absolute time is a preconfigured time reference, and the preconfigured time reference is 1986/01/01 00. Compared with 4G,5G, because more application scenarios, especially ultra-high-reliability low-latency (URLLC) service, are supported, 5G requires a shorter frame structure than LTE. In LTE/LTE-a, the subcarrier spacing is fixed at 15khz, and the spacing of the most basic subcarriers is defined at 15KHz in the 5g NR system, and flexible extension is possible.
The flexible extension means that the subcarrier spacing of the 5G NR system can be obtained by the following formula:
15*(2^m)KHz,m{-2,0,1,2…5}
as can be seen from the above formula, the subcarrier spacing may be 3.75KHz, 7.5KHz, 15KHz, 30KHz, 60KHz, 120KHz …, and the corresponding relationship table of the subframe length and the subcarrier spacing is shown in table 1 below:
TABLE 1
Figure GDA0003942552280000081
Since the terminal equipment analyzes the time obtained by the effective system frame number sent by the base station, the time precision is the same as the subframe length. Therefore, the larger the subcarrier spacing is, the smaller the subframe length corresponding to the subframe number is, and the greater the obtained time accuracy is.
The calculation of the system frame number and its subframe number sent by the base station to the terminal device is calculated based on the absolute time and the high-precision time X1 obtained by the base station from the GPS through the built-in time service system. For example, first, the base station acquires, from the GPS, a current time X1 and an absolute time 1986/01/01 00. Then, the modulus M of X1 and the absolute time is obtained by unifying X1 and the absolute time in ms. Then, the X1 and the module value M of the absolute time are subjected to a complementary operation on the repetition period 10240ms of the system frame number to obtain a residual value Y2. Then, the remainder value Y2 is divided by the slot 10ms of one system frame to obtain a value Y3. And finally, rounding the value Y3 to obtain the system frame number Framenumber.
The calculation of the subframe number is based on the subframe length corresponding to the subcarrier spacing and the value Y2. First, Y2 performs a modulo operation on the cycle 10ms of one system frame to obtain a remainder H1. Then, the remainder H1 is divided by the subframe length y (as shown in table 1, the subframe lengths corresponding to different subcarrier intervals are different) to obtain a value H2. And finally, rounding the value H2 to obtain the subframe number. And the base station sends the calculated system frame number Framenumber and subframe number Subframenumber to the terminal equipment.
Step S204: and the terminal equipment receives the time acquisition instruction.
Specifically, the terminal device periodically analyzes the system frame number according to a preset frequency to obtain the time after the high-precision system frame number is analyzed. That is, the terminal device periodically updates the local time according to the preset frequency. The preset frequency can be set by a user, or can be set by a terminal device system before the terminal device leaves a factory. Then, when the terminal device knows that a period is reached, the terminal device executes the time acquisition method of the present application. For example, when the timer reaches the time of one period, a pulse signal is sent to a system frame number analysis unit of the terminal device, and after receiving the pulse signal, the terminal device performs system frame number analysis, so as to update the local time of the terminal device; the pulse signal sent by the timer is equivalent to a time acquisition instruction, and the terminal equipment is triggered to analyze the system frame number.
Optionally, the terminal device may further set a timing mechanism, set one or more fixed times, and analyze, at the set fixed time, the system frame number received from the base station, where the fixed time may be set by a user, or may be set by the terminal device system before the terminal device leaves a factory. Then, when the terminal device knows that the preset time is reached, the terminal device executes the time obtaining method of the present application. For example, when the timer reaches a preset time, a pulse signal is sent to a system frame number analysis unit of the terminal device, and after receiving the pulse signal, the terminal device analyzes the system frame number, so as to update the local time of the terminal device; the pulse signal sent by the timer is equivalent to a time acquisition instruction, and the terminal equipment is triggered to analyze the system frame number.
Optionally, the terminal device may further receive the time obtaining instruction according to a time update function control key on a screen of the terminal device clicked by the user. For example, a sensor of the terminal device receives a touch signal of a user clicking a screen of the terminal device, the sensor sends the touch signal to a system frame number analysis unit of the terminal device, and after receiving the touch signal, the terminal device analyzes the system frame number, so as to update the local time of the terminal device; the touch signal sent by the sensor is equivalent to a time acquisition instruction, and the terminal equipment is triggered to analyze the system frame number.
The above three modes can be implemented individually or in combination.
Therefore, in this embodiment, the time acquisition instruction provides a specific time triggering condition for the terminal device to analyze the effective system frame number and subframe number thereof sent by the base station, so that the terminal device can ensure the time accuracy under the condition of low energy consumption.
Step S205: and setting a time threshold value, and judging the validity of the system frame number and the subframe number thereof.
Specifically, the terminal device sets a time threshold, and determines whether the storage time of the system frame number Framenumber and the subframe number thereof received by the terminal device from the base station exceeds the time threshold, so as to determine the validity of the received system frame number and the subframe number thereof. When the system frame number and the subframe number storage duration do not exceed the time threshold, the system frame number is an effective system frame number, otherwise, the system frame number is an ineffective system frame number. When the terminal device receives the invalid system frame number, the terminal device discards the invalid system frame number and waits for the next valid system frame number. For example, the time threshold k is 0.2ms, and the terminal device determines that the system frame number and the subframe number thereof are valid frame numbers if the duration of the system frame number and the subframe number thereof stored after the reception is within 0.2ms since the time when the terminal device receives the system frame number sent by the base station. Otherwise, the terminal equipment judges that the frame number is an invalid frame number.
Step S206: and the terminal equipment analyzes the effective system frame number sent by the base station to obtain high-precision time corresponding to the system frame number.
Specifically, the time obtained by analyzing the system frame number is divided into three processes. First, a second time F1 is obtained based on the absolute time, the number X of system frame number cycles from the absolute time to the local time of the terminal device, the number of frames in which the system frame number cycles once, and the length of the system frame. The second time F1 represents the time corresponding to the cycle of the system frame number X times from the absolute time to the local time of the terminal device. Wherein F1= S + X h z. Wherein S represents absolute time, and is in milliseconds, and the absolute time S is a preconfigured time reference, and in this embodiment, the preconfigured time reference is 1986/01/01 00; x represents the number of times of system frame number repetition from the absolute time to the local time acquired by the terminal equipment through the mobile network; h is the number of frames of the system frame number cycle once, and this embodiment takes the number of frames of the system frame number cycle once as 1024 frames as an example; z is the length of one system frame, where z is in milliseconds, and this embodiment takes the length of one system frame as 10ms as an example; framenumber indicates the system frame number.
The number X of times the system frame number is repeated from the absolute time to the local time acquired by the terminal device through the mobile network is calculated as follows. The terminal device obtains the local time as N (the precision error is less than two seconds) through the mobile network, the error range of the first time F corresponding to the system frame number of the base station is 2s, and the following inequality (converting the units of F and N into ms) can be obtained:
f-2000 Nt 1000 straw (F + 2000) F +2000, namely:
S+X*1024*10+Framenumber*10-2000<N*1000<S+X*1024*10+Framenumber*10+2000
fig. 4 is a schematic diagram, where fig. 4 is a value range diagram of a local time of a terminal device according to an embodiment of the present application.
From this, it can be deduced that X is an integer satisfying the following two inequalities:
x10240 (N + 2) 1000-S-Framenumber 10 formula 1
X10240 (N-2) 1000-S-Framenumber 10 formula 2
If the accuracy of the local time N or Framenumber of the terminal device does not meet the above requirement, the integer X meeting the formulas 1 and 2 does not exist, and as long as the error range of the local time N and the first time F of the terminal device is 2s, the equations 1 and 2 can be obtained by combining:
x = floor { ([ N + 2) × 1000-S-framework 10]/1024 × 10} where floor {. Is an integer function.
Thus, in this embodiment, the second time F1= S + X1024 × 10.
Second, a third time F2 is calculated based on the effective system frame number and the length of the system frame number, i.e., F2= Framenumber xz. The third time F2 indicates a duration corresponding to the system frame number received by the terminal device. In the present embodiment, the third time F2= Framenumber × 10.
Finally, the first time F is derived based on the second time F1 and the third time F2, i.e.: f = S + X h X z + Framenumber z. The first time represents a time obtained after the terminal device analyzes the valid system frame number transmitted from the base station. In this embodiment, F = S + X1024 + 10+ Framenumber 10.
In this embodiment, since the length of each frame of the system frame is 10ms, the accuracy of the time F corresponding to the system frame number is the same as the length of the system frame. Therefore, the accuracy of the time obtained by the terminal device analyzing the valid system frame number is 10ms.
Optionally, referring to step S203, multiple subcarrier spacings are supported in the 5G NR system, and the lengths of system subframes corresponding to different subcarrier spacings are different, taking the subcarrier spacing as 15KHz as an example, when the subcarrier spacing is 15KHz, the corresponding subframe length is 1ms, and the formula of the first time F is:
F=S+X*10240+Framenumber*10+Subframenumber*1
wherein subframe number represents a system subframe number; y represents the subframe length corresponding to the system subframe number, and y is in milliseconds. At this time, the time precision of the first time F obtained by analyzing the system frame number by the terminal device is 1ms, and it is seen that the obtained time precision is also changed by adjusting the subcarrier interval, the precision of the first time F is the same as the length of the system subframe, and the larger the subcarrier interval (the highest is 480 KHz), the larger the obtained time precision is. In the present embodiment, since the length of the system subframe is 1ms, the accuracy of the first time F is 1ms.
Step S207: and the terminal equipment updates the time obtained by analyzing the system frame number into the local time of the terminal equipment.
After the terminal equipment analyzes the effective system frame number sent by the base station, a high-precision time (millisecond level, different subcarrier intervals and changed time precision) is obtained. The terminal equipment updates the obtained time of the effective system frame number into the current local time of the terminal equipment, replaces the original time value (the general error range is 2s when the world is coordinated) obtained by the terminal equipment through a mobile network, displays the updated time on a display screen of the terminal equipment and feeds back the updated time to the user. After receiving a touch signal of a user, the terminal equipment analyzes an effective system frame number sent by the base station, displays high-precision time corresponding to the updated system frame number on a display screen, and feeds back a message of completing time updating to the user, wherein the message of completing time updating comprises: voice message, text message.
According to the embodiment of the application, the system frame number sent by the base station is analyzed through the terminal equipment, the system frame number comprises the high-precision time currently acquired by the base station from the high-precision time source, and the first time F is acquired. The first time F is a high-precision time obtained by the terminal device analyzing the system frame number sent from the base station. The terminal equipment receives the time acquisition instruction according to a period or at least one preset moment, judges the system effective frame number sent by the base station after receiving the time acquisition instruction, judges whether the system effective frame number is the effective frame number, discards the invalid system frame number for the terminal equipment and waits for the next effective system frame number. After the terminal device determines the valid system frame number, the number of system frame number cycles from the absolute time to the terminal device local time is calculated based on the absolute time, the valid system frame number, and the terminal device local time (the terminal device obtains through the mobile network). Then, the terminal device calculates a second time based on the absolute time, the cycle number, the frame number of the system frame number which cycles once, and the system frame length; calculating a third time based on the system frame number and the system frame length; and obtaining a first time based on the second time and the third time, updating the local time of the terminal equipment to the first time, and displaying the first time on the display screen. If the terminal equipment receives the user touch signal, the terminal equipment analyzes the system frame number according to the method, and after the first time F is obtained, the terminal equipment displays the updated time on the display screen, and sends a message that the time updating is completed similarly back to the user so as to inform the user that the time updating is completed. In the method of this embodiment, the system frame number sent by the base station carries information of the high-precision time acquired by the base station, and the time obtained by the terminal device through analyzing the system frame number is actually the time obtained by the base station from other high-precision clock sources through the built-in module, and this time is higher in precision (generally in the order of ms) than the time obtained by the terminal device through the mobile network. Therefore, the time precision is improved after the local time is updated by the terminal equipment.
The method of the embodiments of the present application is explained in detail above, and the related apparatus of the embodiments of the present application is provided below.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a time obtaining apparatus provided in an embodiment of the present application, where the time obtaining apparatus 50 may include a time obtaining instruction receiving unit 501, a system frame number parsing unit 502, and a time updating unit 503, where details of each unit are as follows:
a time acquisition instruction receiving unit 501 configured to receive a time acquisition instruction;
a system frame number analyzing unit 502, configured to respond to the time obtaining instruction, and obtain a first time F by analyzing an effective system frame number sent by a base station;
a time updating unit 503, configured to update the local time of the terminal device to the first time F.
In a possible implementation manner, the time obtaining apparatus may further include:
a network time obtaining unit 504, configured to obtain the current local time by moving the network time.
In a possible implementation manner, the time obtaining apparatus may further include:
the triggering unit 505 is configured to receive an input touch signal, where the input control signal is a time obtaining instruction.
In a possible implementation manner, the time obtaining apparatus further includes:
the system frame number determining unit 506 is configured to determine whether the system frame number received from the base station and the subframe number storage time thereof exceed the time threshold i, so as to determine validity of the received system frame number and the subframe number thereof.
In a possible implementation manner, the time obtaining apparatus further includes:
a system frame number cycle number calculating unit 507, configured to calculate a number X of times that a system frame number cycles from the absolute time to the local time of the terminal device, where the number X includes:
X=floor{(C-Framenumber*10)/(h*z)};
wherein h is the frame number of the system frame number circulating once; the z is the length corresponding to one system frame, and the z is taken as a unit of millisecond; c is the time length from the absolute time to the adjustment time of the terminal equipment, and C is in milliseconds; the adjusting time is the time obtained by adding a first time length k to the local time of the terminal equipment; the first time length k is an error range between the local time of the terminal device and the first time F.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a system frame number parsing unit of a time obtaining apparatus according to an embodiment of the present disclosure, in which the system frame number parsing unit 502 includes a first parsing unit 5021, a second parsing unit 5022, and a combining unit 5023, and each of the units is described in detail as follows:
a first parsing unit 5021, configured to obtain a second time F1 based on the absolute time, the number of times that the system frame number cycles from the absolute time to the local time of the terminal device, where a functional expression of the second time F1 is F1= S + X h z; wherein S is absolute time and takes millisecond as unit; x is the number of times of system frame number circulation from absolute time to local time of the terminal equipment; h is the frame number of the system frame number circulating once; z is the length corresponding to one system frame, and z is in milliseconds.
A second parsing unit 5022, configured to obtain a third time F2 based on the length of one system frame and the received effective system frame number sent by the base station, where a function expression of the third time is F2= Framenumber xz;
the combining unit 5023 is configured to obtain a time corresponding to the system frame number based on the second time F1 and the third time F2.
It is understood that the description of each unit in the time acquisition device 50 may also correspond to an embodiment of the time acquisition method, and is not described in detail here.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a terminal device provided in an embodiment of the present application, where the terminal device 70 may include a processor 701 and a memory 702, where details of each unit are described as follows.
The Memory 702 is used for storing program code, and the Memory 702 may be a Read-Only Memory (ROM) or other types of static storage devices that can store static information and instructions, a Random Access Memory (RAM) or other types of dynamic storage devices that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory may be self-contained and coupled to the processor via a bus. The memory may be integral to the processor.
The processor 701 is configured to call the program code stored in the memory to perform the following steps: receiving a time acquisition instruction; responding to the time acquisition instruction, and analyzing the received effective system frame number sent by the base station to obtain first time F; updating the local time to the first time F.
The processor 701 may be a general purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs according to the above schemes.
In one possible implementation, the processor 701 is further configured to: obtaining a second time F1 based on the absolute time and the number of times of circulation of a system frame number from the absolute time to the local time of the terminal equipment; obtaining a third time F2 based on the length of a system frame and the received effective system frame number sent by the base station; and combining the second time F1 and the third time F2 to obtain the first time F.
In one possible implementation, the processor 701 is further configured to: obtaining the number X of times of system frame number circulation from the absolute time to the local time of the terminal equipment according to the time length from the absolute time to the adjustment time of the terminal equipment and the effective system frame number, wherein the calculation formula of X is as follows:
X=floor{(C-Framenumber*z)/(h*z)};
wherein C is the time length from the absolute time to the adjustment time of the terminal equipment, and C is in milliseconds; the adjusting time is the time obtained by adding a first time length k to the local time of the terminal equipment; the first time length k is an error range between the local time of the terminal equipment and the first time F; framenumber is the effective system frame number; h is the frame number of the system frame number circulating once; the z is a length corresponding to one system frame, and the z is in milliseconds.
In one possible implementation, the processor 701 is further configured to: obtaining the second time F1 according to the formula F1= S + X h z; wherein S is absolute time, and S is in milliseconds; obtaining the third time F2 according to a formula F2= Framenumber × z; the first time is obtained according to the formula F = F1+ F2.
In a possible implementation manner, the processor 701 is further configured to: obtaining the second time F1 according to the formula F1= S + X h X z; obtaining the third time F2 according to a formula F2= Framenumber × z; obtaining the fourth time F3 according to the formula F3= subframe number y; wherein subframe number is the effective system subframe number; y is the length corresponding to the system subframe, and the y is taken as a unit of millisecond. The first time is obtained according to the formula F = F1+ F2+ F3.
In a possible implementation manner, the processor 701 is further configured to: and judging whether the storage duration of the received system frame number exceeds a time threshold, wherein the effective system frame number is the system frame number of which the storage duration does not exceed the time threshold.
It should be noted that, for the functions of each functional unit in the terminal device 70 described in the embodiment of the present application, reference may be made to the related description of steps S201 to S206 in the method embodiment described in fig. 2, which is not described herein again.
The embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium may store a program, and when the program is executed, the program includes some or all of the steps of any one of the time acquisition methods described in the above method embodiments.
Embodiments of the present application further provide a computer program, where the computer program includes instructions, which, when executed by a computer, enable the computer to perform part or all of the steps of any one of the time acquisition methods.
It should be noted that, for simplicity of description, the foregoing method embodiments are expressed as a series of combinations of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. 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 may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present application may be essentially or partially contributed by the prior art, or all or part of the technical solution may be embodied in the form of software, where the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, a network device, or the like, and may specifically be a processor in the computer device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. Among them, the aforementioned storage medium may include: a U disk, a removable hard disk, a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or other various media capable of storing program codes.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art will appreciate that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (11)

1. A time obtaining method is applied to a terminal device and comprises the following steps:
receiving a time acquisition instruction;
responding to the time acquisition instruction, and analyzing an effective system frame number sent by the base station to obtain a first time F;
updating the local time of the terminal equipment to the first time F;
the analyzing the effective system frame number sent by the base station to obtain the first time F includes:
obtaining a second time F1 based on the absolute time and the circulating times of the system frame number from the absolute time to the local time of the terminal equipment; obtaining a third time F2 based on the length of a system frame and the effective system frame number sent by the base station;
and combining the second time F1 and the third time F2 to obtain the first time F.
2. The method of claim 1, wherein said combining said second time F1 and said third time F2 to obtain said first time F comprises:
obtaining the first time F according to a formula F = F1+ F2;
wherein F1= S + X h z; f2= Framenumber z;
wherein S is absolute time, and S is taken as unit of millisecond; x is the number of times of circulation of the system frame number from the absolute time to the local time of the terminal equipment; h is the frame number of the system frame number circulating once; z is the length of one system frame, and z is in milliseconds; framenumber is the effective system frame number.
3. The method of claim 1, wherein said combining said second time F1 and said third time F2 to obtain said first time F comprises:
obtaining the first time F according to a formula F = F1+ F2+ F3;
wherein F1= S + X h z; f2= Framenumber z; f3= subframe number y;
wherein S is absolute time, and S is taken as unit of millisecond; x is the number of times of circulation of the system frame number from the absolute time to the local time of the terminal equipment; h is the frame number of the system frame number circulating once; z is the length corresponding to one system frame, and the z is in milliseconds; framenumber is the effective system frame number; f3 is a fourth time F3 obtained based on the length of one system subframe and the effective system subframe number sent by the base station; subframe number is the effective system subframe number; y is the length of the system subframe, and the y is in milliseconds.
4. The method according to claim 2 or 3, wherein the number X of times that the system frame number cycles from the absolute time to the terminal device local time comprises:
X=floor{(C-Framenumber*10)/(h*z)};
wherein C is the time length from the absolute time to the adjustment time of the terminal equipment, and C is in milliseconds; the adjustment time is the local time of the terminal equipment plus the time of a first time length k; the first time k is an error range of the local time of the terminal equipment and the first time F; h is the frame number of the system frame number circulating once; the z is the length of one system frame, and the z is in milliseconds.
5. The method of claim 3, wherein the system subframe number corresponds to a subframe length based on a subcarrier spacing and is incremented cyclically with a fixed period.
6. The method according to any of claims 1-3 or 5, further comprising determining whether a duration of saving of the received system frame number exceeds a time threshold, wherein the valid system frame number is a system frame number for which the duration of saving does not exceed the time threshold.
7. A time acquisition apparatus, comprising:
a time acquisition instruction receiving unit for receiving a time acquisition instruction;
a system frame number analyzing unit, configured to respond to the time acquisition instruction, and analyze an effective system frame number sent by a base station to obtain a first time F;
the time updating unit is used for updating the local time of the terminal equipment to the first time F;
the system frame number parsing unit includes:
the first analysis unit is used for obtaining a second time F1 based on the absolute time, the number of times of circulation of a system frame number from the absolute time to the local time of the terminal equipment;
a second parsing unit, configured to obtain a third time F2 based on a length of a system frame and the effective system frame number sent by the base station;
and the combining unit is used for combining the second time F1 and the third time F2 to obtain the first time.
8. The time acquisition apparatus according to claim 7, wherein the combining unit is specifically configured to:
obtaining the first time F according to a formula F = F1+ F2;
wherein F1= S + X h z; f2= Framenumber z;
wherein S is absolute time, and S is taken as unit of millisecond; x is the number of times of circulation of the system frame number from the absolute time to the local time of the terminal equipment; h is the frame number of the system frame number circulating once; z is the length of one system frame, and z is in milliseconds; framenumber is the effective system frame number.
9. The time acquisition apparatus according to any one of claims 7 to 8, characterized in that the time acquisition apparatus further comprises:
and the system frame number judging unit is used for judging whether the storage duration of the received system frame number exceeds a time threshold, and the effective system frame number is the system frame number of which the storage duration does not exceed the time threshold.
10. A terminal device, comprising: a processor and a memory;
wherein the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory and executing the method according to any one of claims 1-6.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
CN202010876737.5A 2020-08-27 2020-08-27 Time acquisition method, related device and equipment and computer readable storage medium Active CN114124273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010876737.5A CN114124273B (en) 2020-08-27 2020-08-27 Time acquisition method, related device and equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010876737.5A CN114124273B (en) 2020-08-27 2020-08-27 Time acquisition method, related device and equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114124273A CN114124273A (en) 2022-03-01
CN114124273B true CN114124273B (en) 2023-04-04

Family

ID=80374261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010876737.5A Active CN114124273B (en) 2020-08-27 2020-08-27 Time acquisition method, related device and equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114124273B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959147A (en) * 2009-07-14 2011-01-26 中兴通讯股份有限公司 Method and device for acquiring time information by mobile terminal
JP2019029716A (en) * 2017-07-26 2019-02-21 株式会社Nttドコモ Radio base station, timing control method, and user terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388740B (en) * 2007-09-10 2012-12-26 展讯通信(上海)有限公司 Method and system for obtaining and transmitting GPS standard time in TD-SCDMA radio communication system
EP3627957B1 (en) * 2017-06-19 2021-09-08 Huawei Technologies Co., Ltd. Hyper system frame number determining method, communication method and devices

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959147A (en) * 2009-07-14 2011-01-26 中兴通讯股份有限公司 Method and device for acquiring time information by mobile terminal
JP2019029716A (en) * 2017-07-26 2019-02-21 株式会社Nttドコモ Radio base station, timing control method, and user terminal

Also Published As

Publication number Publication date
CN114124273A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
EP2469765B1 (en) Method and system for implementing time synchronization in local area network (lan)
CN110324889A (en) Clock synchronizing method, communication device and communication equipment
CN110662283A (en) Clock synchronization method and device
CN113328820B (en) Method for interacting time synchronization message and network device
WO2020043181A1 (en) Clock synchronization method and apparatus, system, storage medium, and electronic device
CN106686714B (en) Clock synchronizing method, synchronizing information method and device
CN103167474A (en) Enhanced multiple sim time tracking
CN109560889A (en) A method of realizing App and server-side time synchronization
US7373250B2 (en) AGPS module time synchronization method and device using system time information in mobile terminal
CN101770016B (en) GPS time service signal generator based on Beidou satellite
CN109085615A (en) A kind of BPC big dipper multi-mode time service method and system
CN102281114A (en) Service time leap second processing method
CN109085616A (en) A kind of satellite timing method, device and storage medium
CN107682925A (en) A kind of determination method and device of access time
CN114095109A (en) Clock synchronization method, device, equipment and storage medium
CN110710310B (en) Super system frame number determining method, communication method and device
WO2016025287A1 (en) Gps time-aiding and frequency correction
CN114124273B (en) Time acquisition method, related device and equipment and computer readable storage medium
CN101136697B (en) Downlink synchronization tracking method of time-division synchronization CDMA access system
WO2015042955A1 (en) Synchronization method and apparatus
US9143250B2 (en) Blood glucose monitoring system having wireless communication module to which time synchronization method is applied
CN113015236B (en) Bottom-up clock synchronization method and device
JP2004023350A (en) Base station, communication method, communication program, and computer-readable recording medium stored with the communication program
WO2022028716A1 (en) Ue based time synchronization in 5gs with gm clock on the ue side
KR20040106981A (en) 1PPS generator using GPS

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