CN107046600B - Method and device for determining standard time of Android system - Google Patents

Method and device for determining standard time of Android system Download PDF

Info

Publication number
CN107046600B
CN107046600B CN201710138987.7A CN201710138987A CN107046600B CN 107046600 B CN107046600 B CN 107046600B CN 201710138987 A CN201710138987 A CN 201710138987A CN 107046600 B CN107046600 B CN 107046600B
Authority
CN
China
Prior art keywords
time
terminal
last
standard
standard 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.)
Active
Application number
CN201710138987.7A
Other languages
Chinese (zh)
Other versions
CN107046600A (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.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Imoo Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Imoo Electronic Technology Co Ltd filed Critical Guangdong Imoo Electronic Technology Co Ltd
Priority to CN201710138987.7A priority Critical patent/CN107046600B/en
Publication of CN107046600A publication Critical patent/CN107046600A/en
Application granted granted Critical
Publication of CN107046600B publication Critical patent/CN107046600B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72451User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to schedules, e.g. using calendar applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Stored Programmes (AREA)
  • Electric Clocks (AREA)

Abstract

The invention belongs to the technical field of software communication, and discloses a method and a device for determining standard time of an Android system. The method for determining the standard time of the Android system comprises the following steps: acquiring standard time of the last starting time of the terminal; and determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment. In the process, the determination of the terminal standard time is irrelevant to the Android system time which can be modified by a user, and the starting operation time of the relevant Android system can not be modified by the user and can not change along with the change of the Android system time. Therefore, the technical scheme provided by the embodiment of the invention can provide continuous and stable standard time for the application development of the Android system.

Description

Method and device for determining standard time of Android system
Technical Field
The invention relates to the technical field of software communication, in particular to a method and a device for determining standard time of an Android system.
Background
The API of the Android system may provide system time for application developers to use when developing various applications such as an anti-addiction system, however, since the system time may be modified at will by a user, accuracy may not be guaranteed, and serious errors may be generated in the development and use processes of the applications.
Aiming at the problems, the method is mainly used for calibrating the system time of the Android system at present. Common system time calibration methods include various methods such as synchronizing system time by using a network server, performing time calibration by using a GPS positioning service, and setting an external timer to perform time calibration. In the method, the network server is used for synchronizing the system time to be over-dependent on the network, and once the network is in poor condition or the user disconnects the network by self, the time calibration cannot be effectively carried out; the time calibration through the GPS positioning service is too dependent on the signal strength of the GPS, and the time calibration cannot be effectively carried out when the mobile terminal is positioned indoors or in other environments with weak GPS signals; the external hardware equipment is required to be added when the external timer is set for time calibration, so that the hardware cost and the power consumption are improved, and the practicability is poor.
Therefore, how to provide a continuous and stable standard time for the application development of the Android system becomes a problem which must be considered by technicians.
Disclosure of Invention
The embodiment of the invention provides a method and a device for determining standard time of an Android system, and aims to solve the problem of how to provide continuous and stable standard time for application development of the Android system.
The first aspect of the embodiment of the invention provides a method for determining standard time of an Android system, which comprises the following steps:
acquiring standard time of the last starting time of the terminal;
and determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment.
A second aspect of the embodiments of the present invention provides a device for determining standard time of an Android system, including:
the standard time acquisition module is used for acquiring the standard time of the last starting time of the terminal;
and the first standard time determining module is used for determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment.
In the embodiment of the invention, the standard time of the last starting time of the terminal is obtained; and determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment. In the process, the determination of the terminal standard time is irrelevant to the Android system time which can be modified by a user, and the starting operation time of the relevant Android system can not be modified by the user and can not change along with the change of the Android system time. Therefore, the technical scheme provided by the embodiment of the invention can provide continuous and stable standard time for the application development of the Android system.
Drawings
Fig. 1 is a flowchart of a method for determining standard time of an Android system according to a first embodiment of the present invention;
fig. 2A is a flowchart of a method for determining standard time of an Android system according to a second embodiment of the present invention;
FIG. 2B is a schematic diagram of the time axis of the embodiment of FIG. 2A;
fig. 3A is a flowchart of a method for determining standard time of an Android system according to a third embodiment of the present invention;
FIG. 3B is a schematic diagram of the time axis of the embodiment of FIG. 3A;
fig. 4 is a structural diagram of a device for determining standard time of an Android system according to a first embodiment of the present invention;
fig. 5 is a structural diagram of a device for determining standard time of an Android system according to a second embodiment of the present invention;
fig. 6 is a structural diagram of a device for determining standard time of an Android system according to a third embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method and a device for determining standard time of an Android system, and aims to solve the problem of how to provide continuous and stable standard time for application development of the Android system.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the 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 invention.
Referring to fig. 1, a first embodiment of a method for determining an Android system standard time according to an embodiment of the present invention includes:
101. acquiring standard time of the last starting time of the terminal;
the terminal can be various intelligent terminals using an Android system, including a smart phone, a tablet computer and the like. The last time the terminal is turned on last time, and the standard time refers to a time that can be considered as a standard, such as beijing time. The method for obtaining the standard time of the last starting time of the terminal can be various, for example, the standard time can be automatically obtained through a network at the starting time, and the standard time can be obtained by deducting according to the standard time of a certain historical appointed time.
102. And determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment.
After the standard time of the last starting time of the terminal is obtained, the standard time of the terminal at the current time can be determined according to the standard time of the last starting time and the starting operation time of the terminal system at the current time. The API of the Android system can provide two important times, the first is system time, namely the most common time which can be modified by a user, such as time displayed at the lower right of a computer and time displayed on a mobile phone; the second is the system startup running time, which records the running time of the system from startup to the current time, the time can not be changed due to the change of the system time and can not be modified by the user, and the system is reset and then is reset to start the timing. And the terminal system boot operation time at the current moment is the time from the last boot time to the current moment of the system of the terminal, and the standard time of the terminal at the current moment can be obtained by adding the standard time at the last boot time to the boot operation time of the terminal system at the current moment. If the standard time of the last time of the terminal is 11:00:00 of No. 2/22 in 2017 and the system startup operation time of the current time is 3:03:20, it can be determined that the standard time of the terminal at the current time is 14:03:20 of No. 2/22 in 2017.
Further, before step 101, the method may further include:
when the terminal is started, judging whether a system of the terminal is operated for the first time;
if the system of the terminal is operated for the first time, determining the system time of the terminal at the current moment as the standard time of the terminal at the current moment;
if the system of the terminal is not operated for the first time, step 101 is executed.
When the terminal is started, whether the system of the terminal is operated for the first time can be judged, if the system of the terminal is operated for the first time, the system time of the terminal at the current moment can be determined as the standard time of the terminal at the current moment, otherwise, the step 101 is executed. If the terminal leaves the factory just before the Android system is operated for the first time, the terminal never synchronizes with the server for time, and at the moment, because the standard time of the last starting time of the terminal cannot be determined, the standard time of the terminal at the current time cannot be determined according to the standard time of the last starting time and the starting operation time of the terminal system at the current time. For such a situation, the system time of the terminal at the current moment can be directly determined as the standard time of the terminal at the current moment, so that the normal execution of the algorithm is ensured.
Obviously, when the terminal is started, whether the system of the terminal is operated for the first time or not is judged, so that the practicability of the determination method of the Android system standard time can be further improved, and the method is suitable for implementation under various conditions.
In the embodiment of the invention, the standard time of the last starting time of the terminal is obtained; and determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment. In the process, the determination of the terminal standard time is irrelevant to the Android system time which can be modified by a user, and the starting operation time of the relevant Android system can not be modified by the user and can not change along with the change of the Android system time. Therefore, the technical scheme provided by the embodiment of the invention can provide continuous and stable standard time for the application development of the Android system.
Referring to fig. 2A, a second embodiment of a method for determining standard time of an Android system according to the embodiment of the present invention includes:
201. after the last starting-up time, acquiring the last determined standard time of the terminal and the historical appointed time corresponding to the last determined standard time;
and after the last starting time, acquiring the last determined standard time of the terminal and the historical appointed time corresponding to the last determined standard time. The time of the server may be acquired through the network as a standard time, and each time the standard time is acquired is referred to as a time alignment. One or more times of standard time may be acquired after the last starting-up time, the latest determined standard time refers to the standard time acquired by the time calibration which is the latest time away from the current time, and the historical specified time refers to the time point corresponding to the latest determined standard time. If the system is started at 11:00:00 (system time), the current time is 14:00:00 (system time), time calibration is performed for three times between 11:00:00 (system time) and 14:00:00 (system time), wherein the last time is 13:30:00 (system time), and the obtained standard time is 13:30:12, the last determined standard time on the terminal, namely 13:30:12, is obtained.
Further, in order to further improve the accuracy and stability of the finally determined terminal standard time at the current time, the method may further include:
judging whether the system time of the terminal is modified or not, or whether the preset calibration time is reached or not;
and if the system time of the terminal is modified or the preset calibration time is reached, acquiring and recording the standard time determined on the terminal at the current moment.
Although theoretically, the method only needs to perform time calibration once, in order to further improve the accuracy and stability of the finally determined terminal standard time at the current time, a time calibration condition may be set, and when the time calibration condition is satisfied, time calibration is triggered once. The time calibration condition may be that each time the system is powered on, the terminal system time is modified or a preset calibration time point is reached.
202. Determining the standard time of the last starting time according to the starting running time of the terminal system at the historical appointed time and the latest determined standard time;
after the last determined standard time of the terminal and the historical appointed time corresponding to the last determined standard time are obtained, the standard time of the last starting time is determined according to the starting running time of the terminal system at the historical appointed time and the last determined standard time. And subtracting the starting-up running time of the terminal system at the historical appointed time from the latest determined standard time to obtain the standard time of the last starting-up time, and if the latest determined standard time is 13:30:12 and the starting-up running time of the terminal system at the historical appointed time is 2:30:12, determining that the standard time of the last starting-up time is 11:00: 00.
203. And determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment.
Step 203 is the same as step 102, and reference can be made to the related description of step 102.
To facilitate understanding of the above steps 201 to 203, please refer to the schematic diagram of the time axis shown in fig. 2B, wherein the T axis represents the time axis, a is the last time of booting, B is the history specified time corresponding to the last determined standard time, C is the current time, Ton is the standard time of the last time of booting, Tx is the standard time determined for a certain time, Ts is the standard time determined for the last time of the terminal, and Tn is the terminal standard time of the current time. Firstly, after a time A, acquiring Ts (assumed to be 13:30:12) and a historical designated time B corresponding to the Ts; then, determining the standard time Ton of the time A according to the terminal system startup operation time D1 (assumed to be 2:30:12) and Ts of the time B, wherein the Ton is Ts-D1 which can be obviously seen from a time axis, namely the Ton can be determined to be 11:00: 00; finally, the terminal standard time Tn of the current time C can be determined according to Ton and the terminal system boot-up running time D2 (assumed to be 3:30:00) of the current time C, and it is obvious from the time axis that Tn is Ton + D2, that is, Tn can be determined to be 14:30: 00.
In the embodiment of the invention, after the last starting time, the latest determined standard time of the terminal and the historical appointed time corresponding to the latest determined standard time are obtained; determining the standard time of the last starting time according to the starting running time of the terminal system at the historical appointed time and the latest determined standard time; and determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment. In the process, the determination of the terminal standard time is irrelevant to the Android system time which can be modified by a user, and the starting operation time of the relevant Android system can not be modified by the user and can not change along with the change of the Android system time. In addition, the accuracy and the stability of the finally determined terminal standard time at the current moment can be further improved by setting the time calibration condition to carry out time calibration for multiple times. Therefore, the technical scheme provided by the embodiment of the invention can provide continuous and stable standard time for the application development of the Android system.
Referring to fig. 3A, a third embodiment of a method for determining an Android system standard time according to an embodiment of the present invention includes:
301. acquiring standard time of the last shutdown time of the terminal;
the last shutdown time refers to a time at which the terminal system is located at the shutdown time closest to the current time, and there may be many methods for obtaining the standard time of the last shutdown time of the terminal, for example, obtaining the standard time of the current time at the last shutdown time through a network server; and determining the standard time acquired at a certain historical time before the last shutdown time, the terminal system startup running time at the historical time, the system startup running time at the last shutdown time and the like.
302. Acquiring the terminal system time at the last power-off time and the terminal system time at the last power-on time;
and acquiring corresponding terminal system time at the last power-off time and the last power-on time, wherein the time from the last power-off time to the last power-on time is called the power-off dormancy time of the system.
303. Determining the time length from the last power-off time to the last power-on time according to the terminal system time at the last power-off time and the terminal system time at the last power-on time;
after the terminal system time at the last power-off time and the terminal system time at the last power-on time are obtained, determining the time length from the last power-off time to the last power-on time according to the terminal system time at the last power-off time and the terminal system time at the last power-on time. The terminal system is in a shutdown state in the period from the last shutdown time to the last startup time, so that the terminal system time in the period cannot be modified, and the time length from the last shutdown time to the last startup time, namely the shutdown dormancy time of the system, can be accurately obtained only by subtracting the terminal system time at the last shutdown time from the terminal system time at the last startup time.
304. Determining the standard time of the last starting-up time according to the standard time of the last starting-up time and the time length between the last starting-up time and the last starting-up time;
after the time length from the last power-on time to the last power-on time is determined according to the terminal system time at the last power-off time and the terminal system time at the last power-on time, the standard time at the last power-on time can be determined according to the standard time at the last power-off time and the time length from the last power-on time to the last power-on time. If the terminal system is powered off at 23:30:00 of number 2/21 in 2017, and the terminal system time at the last power-off time is 20:30:00 (the terminal system time at the last power-off time is not consistent with the standard time due to private modification or other reasons of a user), and the terminal system time at the last power-on time is 6:30:00 of number 2/22 in 2017, the obtained standard time at the last power-off time is 23:30:00 of number 2/21 in 2017, the time length from the last power-off time to the last power-on time is the difference of the two system times, namely 10:00:00, and the obtained standard time at the last power-off time is 10 hours of number 23:30:00 in number 2/21 in 2017, namely 9:30:00 in number 22 in number 2/2017.
305. And determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment.
Step 305 is the same as step 102, and reference can be made to the related description of step 102.
To facilitate understanding of the above steps 301 to 305, please refer to the schematic diagram of the time axis shown in fig. 3B, wherein T axis represents the time axis, a is the last shutdown time, B is the last startup time, C is the current time, Toff is the standard time of the last shutdown time, Soff is the terminal system time of the last shutdown time, Ton is the standard time of the last startup time, Son is the terminal system time of the last startup time, and Tn is the terminal standard time of the current time. Firstly, acquiring the standard time Toff (23: 30:00 of No. 2/21 in 2017) of the last shutdown time of the terminal; then, acquiring the terminal system time Soff (20: 30:00 of No. 2/month 21 in 2017) of the last shutdown time A and the terminal system time Son (6: 30:00 of No. 2/month 22 in 2017) of the last startup time B; then, determining the time length (namely shutdown dormancy time L) between the last shutdown time and the last startup time according to the terminal system time Soff at the last shutdown time A and the terminal system time Son at the last startup time B, wherein L-Son-Soff can be obviously seen on a time axis because the system time cannot be modified when the system is shutdown, namely L is 10:00: 00; then, determining the standard time Ton of the last starting time according to Toff and L, wherein the Ton is Toff + L which is 9:30:00 of No. 2/month 22 in 2017; and finally, determining the terminal standard time Tn of the current time according to the Ton and the terminal system startup running time D (assumed to be 6:00:00) of the current time, wherein Tn is Ton + D as is obvious from a time axis, and thus obtaining 15:30:00 of Tn of 2017, 2 and 22.
In the embodiment of the invention, the acquired standard time of the last shutdown time of the terminal, the acquired terminal system time of the last shutdown time and the acquired terminal system time of the last startup time can be stored in a database, so that the subsequent calling is convenient.
In addition, the embodiment of the present invention may be regarded as a subsequent implementation process of the embodiment shown in fig. 2. If the terminal system is powered off at a certain time after step 203, the standard time of the system power-off time may be determined according to the method in step 203 and stored in the database at the time of powering off the system, and then the standard time of the system power-off time stored in the database may be directly used as the standard time required for the terminal system to perform step 301 when rebooting. Therefore, in the embodiment of the invention, as long as the standard time is acquired once at a certain historical time before the current time, the accurate and stable terminal standard time can be conveniently acquired no matter how many times of startup and shutdown operations of the terminal system occur or the system time of the terminal is randomly modified for many times in the subsequent process. Obviously, the terminal has a very small dependence on the network due to the standard time which needs to be acquired only once through the network.
In the embodiment of the invention, the standard time of the last shutdown time of the terminal is obtained; acquiring the terminal system time at the last power-off time and the terminal system time at the last power-on time; determining the time length from the last power-off time to the last power-on time according to the terminal system time at the last power-off time and the terminal system time at the last power-on time; determining the standard time of the last starting-up time according to the standard time of the last starting-up time and the time length between the last starting-up time and the last starting-up time; and determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment. In the process, the characteristic that the terminal system time cannot be modified when the terminal system is powered off and dormant and the standard time at the moment are stored in the database when the system is powered off each time are utilized, so that the terminal system can determine the terminal standard time at the current moment without time calibration when the terminal system is powered off and powered on again. The terminal standard time is determined regardless of the Android system time which can be modified by a user, and the starting operation time of the related Android system can not be modified by the user and can not change along with the change of the Android system time. Therefore, the technical scheme provided by the embodiment of the invention can provide continuous and stable standard time for the application development of the Android system.
Furthermore, in order to facilitate operation, a calibration flag bit may be set, and the calibration flag bit is automatically reset when the terminal system is powered on, and is automatically set after the system performs time calibration. After the terminal system is started, judging the state of the calibration flag bit: if the state of the calibration flag bit is a reset state, it represents that the time calibration operation has not been performed after the system is powered on, and at this time, the terminal standard time at the current time can be determined according to the method in the embodiment shown in fig. 3; if the state of the calibration flag bit is a set state, it represents that the time calibration operation has been performed after the system is powered on, and at this time, the terminal standard time at the current time may be determined according to the method in the embodiment shown in fig. 2.
The method for determining the standard time of the Android system is mainly described above, and a device for determining the standard time of the Android system will be described in detail below.
Referring to fig. 4, a first embodiment of an apparatus for determining an Android system standard time according to an embodiment of the present invention includes:
a standard time obtaining module 401, configured to obtain a standard time of a last boot time of the terminal;
a first standard time determining module 402, configured to determine the standard time of the terminal at the current time according to the standard time at the last time of starting up and the terminal system starting up operation time at the current time, where the terminal system starting up operation time at the current time is the time that the system of the terminal has operated from the last time of starting up to the current time.
Further, the device for determining the standard time of the Android system may further include:
a second judging module 403, configured to judge whether a system of the terminal is initially operated when the terminal is powered on;
a second standard time determining module 404, configured to determine, if the system of the terminal is in initial operation, the system time of the terminal at the current time as the terminal standard time at the current time.
Referring to fig. 5, a second embodiment of an apparatus for determining an Android system standard time according to the embodiment of the present invention includes:
a standard time obtaining module 501, configured to obtain a standard time of a last boot time of the terminal;
a first standard time determining module 502, configured to determine a terminal standard time at the current time according to the standard time at the last time of starting up and a terminal system starting up operation time at the current time, where the terminal system starting up operation time at the current time is a time that a system of the terminal has operated from the last time of starting up to the current time;
the standard time acquisition module 501 includes:
a first obtaining unit 5011, configured to obtain, after the last boot time, a last determined standard time of a terminal and a historical designated time corresponding to the last determined standard time;
the first determining unit 5012 is configured to determine the standard time of the last boot-up time according to the terminal system boot-up running time at the historical designated time and the last determined standard time.
Further, the device for determining the standard time of the Android system may further include:
a second determining module 503, configured to determine whether a system of the terminal is initially operated when the terminal is powered on;
a second standard time determining module 504, configured to determine, if the system of the terminal is in initial operation, a system time of the terminal at a current time as a terminal standard time of the current time;
a first determining module 505, configured to determine whether the system time of the terminal is modified or whether a preset calibration time is reached;
a recording module 506, configured to obtain and record a standard time determined on the terminal at the current time if the system time of the terminal is modified or a preset calibration time is reached.
Referring to fig. 6, a third embodiment of an apparatus for determining an Android system standard time according to the embodiment of the present invention includes:
a standard time obtaining module 601, configured to obtain a standard time of a last boot time of the terminal;
a first standard time determining module 602, configured to determine a standard time of the terminal at the current time according to the standard time at the last time of starting up and a terminal system starting up operation time at the current time, where the terminal system starting up operation time at the current time is a time that a system of the terminal has operated from the last time of starting up to the current time;
the standard time obtaining module 601 includes:
a second obtaining unit 6011, configured to obtain a standard time of a last shutdown time of the terminal;
a third obtaining unit 6012, configured to obtain the terminal system time at the last shutdown time and the terminal system time at the last startup time;
a second determining unit 6013, configured to determine, according to the terminal system time at the previous shutdown time and the terminal system time at the previous startup time, a time length from the previous shutdown time to the previous startup time;
a third determining unit 6014, configured to determine the standard time of the last startup time according to the standard time of the last shutdown time and a time length between the last shutdown time and the last startup time.
Further, the device for determining the standard time of the Android system may further include:
a second judging module 603, configured to judge whether a system of the terminal is initially operated when the terminal is powered on;
a second standard time determining module 604, configured to determine the system time of the terminal at the current time as the terminal standard time at the current time if the system of the terminal is in initial operation.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, 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. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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 invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art 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 of the embodiments of the present invention.

Claims (6)

1. A method for determining standard time of an Android system is characterized by comprising the following steps:
acquiring standard time of the last starting time of the terminal, wherein the last starting time refers to a time point of the terminal when the terminal is started last time;
determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment;
the acquiring of the standard time of the last boot time of the terminal includes:
acquiring a preset calibration marker bit, wherein the calibration marker bit is reset when the terminal system is started, and is set after the terminal system performs time calibration;
if the calibration flag bit is in a set state, acquiring the latest determined standard time on the terminal and the historical appointed time corresponding to the latest determined standard time; the latest determined standard time refers to the server time which is obtained when time calibration is carried out through a network and is closest to the current time, and the historical appointed time refers to the time point corresponding to the latest determined standard time; subtracting the starting operation time of the terminal system at the historical appointed time from the latest determined standard time to obtain the standard time at the last starting time;
if the calibration flag bit is in a reset state, acquiring the standard time of the last shutdown time of the terminal; acquiring the terminal system time at the last power-off time and the terminal system time at the last power-on time; determining the time length from the last power-off time to the last power-on time according to the terminal system time at the last power-off time and the terminal system time at the last power-on time; and determining the standard time of the last power-on time according to the standard time of the last power-off time and the time length between the last power-off time and the last power-on time, wherein the last power-off time refers to the time point when the terminal is powered off last time.
2. The method for determining the standard time of the Android system according to claim 1, further comprising:
judging whether the system time of the terminal is modified or not, or whether the preset calibration time is reached or not;
and if the system time of the terminal is modified or the preset calibration time is reached, acquiring and recording the standard time determined on the terminal at the current moment.
3. The method for determining the Android system standard time according to claim 1 or 2, wherein before obtaining the standard time of the last boot time of the terminal, the method further comprises:
when the terminal is started, judging whether a system of the terminal is operated for the first time;
if the system of the terminal is operated for the first time, determining the system time of the terminal at the current moment as the standard time of the terminal at the current moment;
and if the system of the terminal is not in initial operation, executing the step of acquiring the standard time of the last starting time of the terminal.
4. An apparatus for determining standard time of an Android system, comprising:
the standard time acquisition module is used for acquiring the standard time of the last starting time of the terminal, wherein the last starting time refers to the time point of the terminal when the terminal is started last time;
the first standard time determining module is used for determining the standard time of the terminal at the current moment according to the standard time of the last starting moment and the starting running time of the terminal system at the current moment, wherein the starting running time of the terminal system at the current moment is the running time of the system of the terminal from the last starting moment to the current moment;
wherein, the standard time acquisition module comprises:
a calibration flag bit obtaining unit, configured to obtain a preset calibration flag bit, where the calibration flag bit is reset when the terminal system is started up, and is set after the terminal system performs time calibration;
the first acquisition unit is used for acquiring the latest determined standard time on the terminal and the historical appointed time corresponding to the latest determined standard time if the calibration flag bit is in a set state; the latest determined standard time refers to the server time which is obtained when time calibration is carried out through a network and is closest to the current time, and the historical appointed time refers to the time point corresponding to the latest determined standard time;
the first determining unit is used for subtracting the starting operation time of the terminal system at the historical appointed time from the latest determined standard time to obtain the standard time at the last starting time;
the second obtaining unit is used for obtaining the standard time of the last shutdown time of the terminal if the calibration flag bit is in a reset state;
a third obtaining unit, configured to obtain a terminal system time at the last power-off time and a terminal system time at the last power-on time;
a second determining unit, configured to determine, according to the terminal system time at the last shutdown time and the terminal system time at the last startup time, a time length from the last shutdown time to the last startup time;
and a third determining unit, configured to determine the standard time of the last power-on time according to the standard time of the last power-off time and a time length between the last power-off time and the last power-on time, where the last power-off time refers to a time point at which the terminal was last powered off.
5. The apparatus for determining the standard time of the Android system according to claim 4, further comprising:
the first judgment module is used for judging whether the terminal system time is modified or not or whether the preset calibration time is reached or not;
and the recording module is used for acquiring and recording the standard time determined on the terminal at the current moment if the system time of the terminal is modified or the preset calibration time is reached.
6. The apparatus for determining the Android system standard time according to claim 4 or 5, further comprising:
the second judging module is used for judging whether a system of the terminal is operated for the first time when the terminal is started;
and the second standard time determining module is used for determining the system time of the terminal at the current moment as the standard time of the terminal at the current moment if the system of the terminal is operated for the first time.
CN201710138987.7A 2017-03-09 2017-03-09 Method and device for determining standard time of Android system Active CN107046600B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710138987.7A CN107046600B (en) 2017-03-09 2017-03-09 Method and device for determining standard time of Android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710138987.7A CN107046600B (en) 2017-03-09 2017-03-09 Method and device for determining standard time of Android system

Publications (2)

Publication Number Publication Date
CN107046600A CN107046600A (en) 2017-08-15
CN107046600B true CN107046600B (en) 2020-12-04

Family

ID=59544621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710138987.7A Active CN107046600B (en) 2017-03-09 2017-03-09 Method and device for determining standard time of Android system

Country Status (1)

Country Link
CN (1) CN107046600B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110474702A (en) * 2018-05-10 2019-11-19 杭州涂鸦信息技术有限公司 One kind being based on System Clock, and relies on the implementation method for the Time Service that server-side is automatically repaired
CN110213005B (en) * 2019-05-17 2021-04-16 厦门网宿有限公司 Time synchronization method, device and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102736512A (en) * 2011-04-15 2012-10-17 国基电子(上海)有限公司 Electronic device and system time setting method thereof
CN104199693A (en) * 2014-08-25 2014-12-10 北京金山安全软件有限公司 Method, device and terminal for obtaining boot time

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103718186B (en) * 2013-09-05 2015-07-08 华为技术有限公司 Storage system and data operation request treatment method
CN103631695B (en) * 2013-12-19 2017-02-08 北京经纬恒润科技有限公司 time monitoring method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102736512A (en) * 2011-04-15 2012-10-17 国基电子(上海)有限公司 Electronic device and system time setting method thereof
CN104199693A (en) * 2014-08-25 2014-12-10 北京金山安全软件有限公司 Method, device and terminal for obtaining boot time

Also Published As

Publication number Publication date
CN107046600A (en) 2017-08-15

Similar Documents

Publication Publication Date Title
KR101641174B1 (en) Method for enabling shutdown alarm clock and mobile terminal, and program, and recording medium for enabling shutdown alarm clock
EP3355223A1 (en) Unlock method and mobile terminal
US9285857B2 (en) Application idle current drain measurement
US20140156599A1 (en) Game state synchronization and restoration across multiple devices
CN107544619B (en) Time synchronization method and device
US20130254527A1 (en) Bios firmware updating method and electronic device
CN109067416B (en) Method for realizing hot plug and start of SIM card and intelligent hardware
CN109375956B (en) Method for restarting operating system, logic device and control device
CN108521647B (en) Bluetooth SIM card pairing method and Bluetooth master device
EP3015987A1 (en) System update method, apparatus, and device
CN107046600B (en) Method and device for determining standard time of Android system
CN107844341B (en) Process starting control method and device, storage medium and mobile terminal
CN105872762A (en) Method and device for installing smart cloud TV application
CN113760333A (en) Software upgrading method and device, electronic equipment and computer readable storage medium
CN115827111A (en) Method and device for adjusting server startup items, storage medium and electronic device
CN109002305B (en) Method and system for updating equipment program
CN106897303B (en) Data query method and device
CN111885420B (en) Standby protection method and device, smart television and readable storage medium
CN111836347A (en) Electric quantity display method, device and equipment and readable storage medium
CN115495160B (en) ARM server, starting method and device thereof, and readable storage medium
CN104350476B (en) A kind of version detection period control method and device
US10986221B2 (en) Execution of testing processes on apparatuses
CN111464688B (en) Working mode switching method and device
CN103902371A (en) Method and system for acquiring inner core jiffies from user mode program
CN107295175B (en) Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230829

Address after: 523860 No. 168 Dongmen Middle Road, Xiaobian Community, Chang'an Town, Dongguan City, Guangdong Province

Patentee after: Guangdong Xiaotiancai Technology Co.,Ltd.

Address before: Room 101, 1st Floor, Office Building A, No. 76 Xingfa Road, Wusha Liwu Industrial Zone, Chang'an Town, Dongguan City, Guangdong Province, 523000

Patentee before: GUANGDONG AIMENG ELECTRONIC TECHNOLOGY CO.,LTD.