Time information processing method, device, equipment, storage medium and program product
By adjusting the time interval of the countdown, the problem of countdown error accumulation is solved, the accuracy and stability of the countdown are improved, and it is suitable for various network and hardware environments.
Patent Information
- Application Number
- CN202110106767.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-01-26
AI Technical Summary
In existing countdown solutions, failure to execute tasks in the task queue in time will lead to countdown errors, which accumulate over time, especially when the network environment and hardware configuration are poor.
By obtaining the remaining time information in the countdown page, calculate the time interval information and expected time information between two adjacent updates, compare the current system time and the expected time, adjust the time interval to the preset interval, and follow the adjusted time interval Update the remaining time information to avoid updating at fixed time intervals.
It effectively reduces the countdown error, improves the accuracy of time information processing, and ensures the accuracy and stability of the countdown.
Smart Images

Figure CN112948071B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device, computer-readable storage medium, and computer program product for processing time information. Background Art
[0002] Currently, more and more application scenarios will use the countdown function. The conventional countdown solution is mainly to set a timer, and the timer reduces the total countdown time by 1 second every 1 second.
[0003] To reduce the total countdown time by 1 second, you need to execute the corresponding task: enter a task in the task queue every 1 second, and the task is used to reduce the total countdown time by 1 second. If there are multiple tasks in the task queue, the multiple tasks in the task queue need to be queued for execution. Affected by factors such as the network environment, hardware configuration, and system resource usage, if a task in the task queue is not executed in time, it will inevitably affect the subsequent tasks, and eventually cause errors in the countdown. Moreover, the longer the total countdown time is, the greater the accumulated errors will be. Summary of the invention
[0004] The present disclosure provides a method, device, electronic device, computer-readable storage medium and computer program product for processing time information, so as to at least solve the problem that the countdown error in the related art will accumulate and become larger and larger. The technical solution of the present disclosure is as follows:
[0005] According to the first aspect of an embodiment of the present disclosure, a method for processing time information is provided, including: obtaining remaining time information in a countdown page; obtaining time interval information between two adjacent updates of the remaining time information, and expected time information for this update of the remaining time information; comparing current system time information with the expected time information, and adjusting the time interval information to a preset interval based on the comparison result; and updating the remaining time information according to the adjusted time interval information.
[0006] Optionally, the acquiring the time interval information between two adjacent updates of the remaining time information includes: subtracting the current system time information from the expected time information of the next update of the remaining time information to obtain the time interval information.
[0007] Optionally, obtaining the expected time information for updating the remaining time information this time includes: generating the expected time information according to initial time information and time threshold information; wherein the initial time information indicates the time point when the remaining time information is updated for the first time.
[0008] Optionally, generating the expected time information according to the initial time information and the time threshold information includes: adding the initial time information to the time threshold information to obtain the expected time information.
[0009] Optionally, adjusting the time interval information to a preset interval based on the comparison result includes: when the comparison result indicates that the current system time information is greater than the expected time information, adjusting the time interval information to the preset interval, the preset interval represents an interval greater than zero and less than the time threshold information, and the time threshold information represents the unit time for updating the remaining time information this time.
[0010] Optionally, updating the remaining time information according to the adjusted time interval information includes: after the remaining time information is updated, updating the current system time information and creating a new timer; using the new timer to perform a timing operation, and when the timing time is the adjusted time interval information, using the timing time of the new timer to update the remaining time information.
[0011] Optionally, when the timing time is the adjusted time interval information, the remaining time information is updated using the timing time of the new timer, including: when the timing time of the new timer is the adjusted time interval information, the remaining time information is updated to the time information difference between the remaining time information and the time threshold information.
[0012] According to a second aspect of an embodiment of the present disclosure, a time information processing device is provided, including: a first time acquisition unit, configured to execute acquisition of remaining time information in a countdown page; a second time acquisition unit, configured to execute acquisition of time interval information between two adjacent updates of the remaining time information, and expected time information for this update of the remaining time information; a time interval adjustment unit, configured to execute comparison between current system time information and the expected time information, and adjust the time interval information to a preset interval according to the comparison result; and a remaining time updating unit, configured to execute update of the remaining time information according to the adjusted time interval information.
[0013] Optionally, the second time acquisition unit is configured to obtain the time interval information by subtracting the current system time information from the expected time information for the next update of the remaining time information.
[0014] Optionally, the second time acquisition unit is configured to generate the expected time information according to initial time information and time threshold information; wherein the initial time information represents the time point when the remaining time information is updated for the first time.
[0015] Optionally, the second time acquisition unit is configured to add the initial time information to the time threshold information to obtain the expected time information.
[0016] Optionally, the time interval adjustment unit is configured to adjust the time interval information to the preset interval when the comparison result indicates that the current system time information is greater than the expected time information, and the preset interval represents an interval greater than zero and less than the time threshold information, and the time threshold information represents the unit time for this update of the remaining time information.
[0017] Optionally, the remaining time update unit includes: an update creation unit, configured to update the current system time information and create a new timer after the remaining time information is updated; a timing update unit, configured to perform a timing operation using the new timer, and when the timing time is the adjusted time interval information, the remaining time information is updated using the timing time of the new timer.
[0018] Optionally, the timing update unit is configured to update the remaining time information to a time information difference between the remaining time information and the time threshold information when the timing time of the new timer is the adjusted time interval information.
[0019] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method for processing time information as described in the first aspect.
[0020] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the method for processing time information as described in the first aspect.
[0021] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for processing time information described in the first aspect is implemented.
[0022] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0023] The time information processing scheme provided by the embodiment of the present disclosure obtains the remaining time information in the countdown page, obtains the time interval information between two adjacent updates of the remaining time information, and the expected time information of the current update of the remaining time information. The current system time information is compared with the expected time information, and according to the comparison result, the time interval information is adjusted to a preset interval, and then the remaining time information is updated according to the adjusted time interval information.
[0024] The embodiment of the present disclosure can adjust the time interval information between two adjacent updates of the remaining time information to avoid updating the remaining time information at a fixed time interval. Updating the remaining time information according to the adjusted time interval information can make up for the error of the current system time information being larger than the expected time information, thereby improving the accuracy of time information processing.
[0025] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0027] Figure 1 The figure is a flowchart of a method for processing time information according to an exemplary embodiment.
[0028] Figure 2 The figure is a schematic diagram of a countdown process according to an exemplary embodiment.
[0029] Figure 3 The invention is a block diagram of a device for processing time information according to an exemplary embodiment.
[0030] Figure 4 The invention is a block diagram of an electronic device for processing time information according to an exemplary embodiment.
[0031] Figure 5 The invention is a block diagram of an electronic device for processing time information according to an exemplary embodiment. DETAILED DESCRIPTION
[0032] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0034] Figure 1 is a flow chart showing a method for processing time information according to an exemplary embodiment. Figure 1 As shown, the method for processing time information can be applied to a terminal or a server. The embodiment of the present disclosure takes countdown as an example to illustrate the processing process of time information. The method for processing time information can specifically include the following steps.
[0035] In step S11, the remaining time information in the countdown page is obtained.
[0036] In the embodiments of the present disclosure, the countdown page may be located in a dedicated countdown application, or the countdown page may be located in a web page, or the countdown page may be an interface for countdown in a certain application. The remaining time information in the countdown page may be understood as the total time of the countdown. For example, if the countdown is 60 seconds, the remaining time information on the countdown page is 60 seconds.
[0037] In one example, a timer is set for the countdown page. When the countdown page is triggered, the timer starts counting down and displays the remaining time information on the countdown page. In addition, a corresponding number of timers are set according to the remaining time information of the countdown page. For example, if the remaining time information is 60 seconds, 60 timers are set, wherein a timer is set for each 1 second in the remaining time information, that is, the first timer is set at the 0th second, the second timer is set at the 1st second, the third timer is set at the 2nd second, ..., and the 60th timer is set at the 59th second. Moreover, the first timer counts the 0th second, the second timer counts the 1st second, the third timer counts the 2nd second, ..., and the 60th timer counts the 59th second. In actual application, when the countdown page is triggered, the first timer is set and started, the first timer starts timing, and the first timer stops timing after 1 second. At the same time, the second timer is set and started, the second timer starts timing, and the second timer stops timing after 1 second. At the same time, the third timer is set and started, the third timer starts timing, and the third timer stops timing after 1 second, ..., the 60th timer is set and started, the 60th timer starts timing, and the 60th timer stops timing after 1 second. At this point, the 60-second timing is completed.
[0038] In step S12, the time interval information between two adjacent updates of the remaining time information and the expected time information of this update of the remaining time information are obtained.
[0039] In an embodiment of the present disclosure, two adjacent updates of the remaining time information can be understood as two adjacent updates of the remaining time information. For example, the first update of the remaining time information and the second update of the remaining time information are considered as two adjacent updates of the remaining time information. In an example, two adjacent updates of the remaining time information can be the current update of the remaining time information and the next update of the remaining time information. The time interval information between two adjacent updates of the remaining time information can be a variable rather than a fixed constant. The expected time information of this update of the remaining time information can be understood as the time point when the remaining time information is updated under ideal circumstances.
[0040] In an exemplary embodiment of the present disclosure, in the process of obtaining the time interval information between two adjacent updates of the remaining time information, the expected time information of the next update of the remaining time information can be subtracted from the current system time information to obtain the time interval information between the two adjacent updates of the remaining time information. For example, when obtaining the time interval information between the first update of the remaining time information and the second update of the remaining time information, the expected time information of the second update of the remaining time information can be subtracted from the current system time information to obtain the time interval information between the first update and the second update. Among them, the first update of the remaining time information is the current update of the remaining time information, and the second update of the remaining time information is the next update of the remaining time information.
[0041] In step S13, the current system time information is compared with the expected time information, and the time interval information is adjusted to a preset interval according to the comparison result.
[0042] In an embodiment of the present disclosure, the current system time information may be the same as the expected time information of the remaining time information of this update, or the current system time information may be greater than the expected time information of the remaining time information of this update. That is, the comparison result between the current system time information and the expected time information of the remaining time information of this update may indicate that the current system time information is the same as the expected time information of the remaining time information of this update, or may indicate that the current system time information is greater than the expected time information of the remaining time information of this update. When the current system time information is the same as the expected time information of the remaining time information of this update, it indicates that it is feasible to update the remaining time information according to the expected time information of the remaining time information of this update. When the current system time information is greater than the expected time information of the remaining time information of this update, it indicates that the expected time information of the remaining time information of this update has been missed, and updating the remaining time information according to the expected time information of the remaining time information of this update will result in errors, and it is necessary to adjust the time interval information so that the remaining time information can be updated in advance for the next time, so as to reduce the error caused by the last update of the remaining time information. For example, compare the current system time information Td with the expected time information Ty of the remaining time information of this update, and adjust the time interval information to a preset interval according to the comparison result of Td and Ty. In one example, when Td is greater than Ty, the time interval information is adjusted to a preset interval.
[0043] In step S14, the remaining time information is updated according to the adjusted time interval information.
[0044] In an embodiment of the present disclosure, a timing operation can be performed based on a set timer, and when the timing time reaches the adjusted time interval information, the remaining time information is updated. For example, the adjusted time interval information is g seconds, and when the timing time of the timer reaches g seconds, the remaining time information is updated.
[0045] The time information processing scheme provided by the embodiment of the present disclosure obtains the remaining time information in the countdown page, obtains the time interval information between two adjacent updates of the remaining time information, and the expected time information of the current update of the remaining time information. The current system time information is compared with the expected time information, and the time interval information is adjusted to a preset interval according to the comparison result, and then the remaining time information is updated according to the adjusted time interval information.
[0046] The embodiment of the present disclosure can adjust the time interval information between two adjacent updates of the remaining time information to avoid updating the remaining time information at a fixed time interval. Updating the remaining time information according to the adjusted time interval information can make up for the error of the current system time information being larger than the expected time information, thereby improving the accuracy of time information processing.
[0047] In the process of obtaining the expected time information of the remaining time information for this update in the above step S12, the expected time information of the remaining time information for this update can be generated based on the initial time information and the time threshold information. Among them, the initial time information indicates the time point when the remaining time information is updated for the first time. In one embodiment, the initial time information is added to the time threshold information to obtain the expected time information of the remaining time information for this update. Among them, the initial time information is the time point Tc when the remaining time information is updated for the first time. The time threshold information Tm indicates the unit time of the remaining time information for this update. Then Tc+Tm=Ty. In the countdown scenario, the remaining time information is usually updated every 1 second, so the above time threshold information can be 1 second.
[0048] In the embodiment of the present disclosure, the current system time information is constantly changing, that is, after each update of the remaining time information, the current system time information is updated, so the current system time information will be slightly larger than the expected time information of the remaining time information updated this time, resulting in an update error in the remaining time information updated this time. The expected time information of the next update of the remaining time information is subtracted from the current system time information to obtain the time interval information between two adjacent updates of the remaining time information. If it is expected that the next update of the remaining time information can make up for the update error caused by the current update of the remaining time information, it is necessary to obtain time interval information slightly smaller than the time threshold information, and update the updated remaining time information again according to the adjusted time interval information.
[0049] In the embodiments of the present disclosure, the initial time information indicates the time point of the first update of the remaining time information. If the remaining time information is updated for the second time, the initial time information is added to the time threshold information to obtain the expected time information of the remaining time information for the current update. If the remaining time information is updated for the third time, the initial time information is added to twice the time threshold information to obtain the expected time information of the remaining time information for the current update. Similarly, if the remaining time information is updated for the Pth time, the initial time information is added to P-1 times the time threshold information to obtain the expected time information of the remaining time information for the current update.
[0050] In an exemplary embodiment of the present disclosure, the process of adjusting the time interval information to a preset interval according to the comparison result in the above step S13 includes: if the comparison result indicates that the current system time information is greater than the expected time information of the remaining time information of this update, then adjusting the time interval information between the remaining time information of this update and the remaining time information of the next update to the preset interval. Since the current system time information is updated after each update of the remaining time information, the current system time information will be slightly greater than the expected time information of the remaining time information of this update, and there is no comparison result indicating that the current system time information is less than the expected time information of the remaining time information of this update. Only when the remaining time information is updated for the first time, the expected time information of the remaining time information of this update of the first update of the remaining time information is the same as the current system time. Among them, the preset interval can be an interval greater than zero and less than the time threshold information. In actual applications, the time interval information can be adjusted to be slightly smaller than the time threshold information. For example, if the time threshold information is 1 second, the time interval information can be adjusted to between 0 and 1 second. Moreover, after each update of the remaining time information, the current system time information will be updated immediately. The current system time is larger than the remaining time information of this update. Therefore, the time interval information is adjusted to a smaller value. There is no need to adjust it too much. For example, the time interval information can be adjusted to be closer to 1 second.
[0051] In an embodiment of the present disclosure, the time interval information is adjusted to a range greater than zero and less than the time threshold information. If the current system time information is slightly larger than the expected time information, the time interval information can be adjusted to be slightly smaller than the time threshold information to compensate for the error of the current system time information being larger than the expected time information.
[0052] In an exemplary embodiment of the present disclosure, each time the remaining time information is updated, a corresponding timer may be created. The implementation process of the above step S14 is as follows:
[0053] After the remaining time information is updated according to the current timer, the current system time information is updated, and a new timer is created, and the new timer is used to perform the next update operation on the remaining time information;
[0054] The new timer is used to perform a timing operation, and when the timing time is the adjusted time interval information, the remaining time information is updated using the timing time of the new timer.
[0055] That is to say, the embodiments of the present disclosure need to create as many timers as the number of times the remaining time information is updated. For each update of the remaining time information, a corresponding timer is created, and the corresponding timer is used to update the remaining time information. If only one timer is used for timing operations during the entire countdown process, the timing operation of one timer belongs to a single-threaded execution mechanism, and is affected by environmental factors and other factors, and the remaining time information will not be accurately updated every 1 second, resulting in update delays. The embodiments of the present disclosure create a corresponding timer for each update of the remaining time information, thereby avoiding the problem of update delays caused by using only one timer for timing operations.
[0056] In an exemplary embodiment of the present disclosure, when the timing time of the new timer is the adjusted time interval information, the remaining time information is updated to be the time information difference between the remaining time information and the time threshold information. In practical applications, for example, the adjusted time interval information is 0.9 seconds, and when the timing time of the new timer is 0.9 seconds, the remaining time information is subtracted by 1 second, and the updated remaining time information is -0.1 seconds. The embodiment of the present disclosure updates the remaining time information, and when applied to a countdown scenario, the remaining time information can be subtracted from the time threshold information. Typically, the time threshold information in the countdown scenario is 1 second, that is, the remaining time information is updated each time by subtracting 1 second from the remaining time information.
[0057] In an exemplary embodiment of the present disclosure, when the timing time of the timer is the adjusted time interval information, the remaining time information can be updated using a time update function. The time update function is used to update the remaining time information in the countdown page. The time update function may include time threshold information, etc. Usually, the time threshold information can be set to 1 second, that is, the time update function updates the remaining time information by 1 second each time. In the countdown application scenario, the time update function subtracts 1 second from the remaining time information each time. The process of updating the remaining time information using the time update function can be divided into updating the remaining time information for the first time and updating the remaining time information for a non-first time.
[0058] When the remaining time information is updated for the first time, an initial timer can be created, and the current system time information is the initial time information. The expected time information of the remaining time information is updated for the second time by the time update function, which is the initial time information plus the time threshold information. Then the initial timer is used to perform timing operations, and when the timing time is the time threshold information, the time update function is called to update the remaining time information for the first time.
[0059] After the remaining time information is updated for the first time, the current system time information is updated and a new timer is created, which is used to time the next update. Since the first update operation is performed first and then the current system time information is updated, the updated current system time will be slightly larger than the expected time information of the second update operation.
[0060] The time interval information between the first update time of the remaining time information for the first update and the second update time of the remaining time information for the second update is obtained, and the current system time information is compared with the expected time information of the first update time, and when the current system time is greater than the expected time information of the first update time, the time interval information between the first update time and the second update time is adjusted. Here, the time interval information between the first update time and the second update time is the time interval information between the remaining time for the first update and the remaining time for the second update, that is, the time interval information between two adjacent remaining time information for updates.
[0061] The new timer created after the first update operation performs the timing operation. When the timing time is the adjusted time interval information, the time update function is called to perform a second update on the remaining time information.
[0062] Similarly, after the second update operation, the current system time information is updated and a new timer is created. The new timer is used to time the next update, i.e., the third update. The expected time information of the third update of the remaining time information by the time update function is the initial time information plus 2 times the time threshold information. Similarly, if the remaining time information needs to be updated 10 times, 10 timers need to be created. The current system time information is obtained during the first update, and then the current system time information is updated 9 times. The current system time information of the first update operation is the initial time information.
[0063] Based on the above description of an embodiment of a method for processing time information, a countdown technical solution is introduced below. Figure 2As shown, define a time update function updatetime, which can be called by the timer to update the remaining time information on the countdown page. Each time the time update function updatetime is called, the time update function updatetime reduces the remaining time information by 1 second. Define the current system time information N 1 (When the countdown is about to start, the current system time information N 1 is the initial time information T 1 ), the remaining time information is L 1 , at this time L 1 Indicates the total unit time of the countdown, for example, L 1 = 30 seconds. The expected time information for the next update is T 2 =T 1 +1 second. Create timer 01, with initial time interval information as G 1 =T 2 -N 1 When timer 01 starts from the initial time information T 1 Timing starts, and the timing time is the initial time interval information G 1 When timer 01 calls the time update function updatetime, the remaining time information L 1 Subtract 1 second. Then, update the current system time information to N 2 , update the remaining time information to L 2 =L 1 -1 second, the expected time information for the next update is T 3 =T 2 +1 second, create timer 02, the second time interval information is G 2 =T 3 -N 2 When timer 02 receives the current system time information N 2 , the timing starts, and the timing time is the second time interval information G 2 When the timer 02 calls the time update function updatetime, the remaining time information L 2 Subtract 1 second. Then, update the current system time information to N 3 , update the remaining time information to L 3 =L 2 -1 second, the expected time information for the next update is T 4 =T 3 +1 second, create timer 03, the third time interval information is G 3 =T 4 -N 3 When timer 03 receives the current system time information N 3, the timing starts, and the timing time is the third time interval information G 3 When the timer 03 calls the time update function updatetime, the remaining time information L 3 Subtract 1 second. And so on, until the current system time information is updated to N m , update the remaining time information to L m =L m-1 -1 second, the expected time information for the next update is T m+1 =T m +1 second, create timer m, the mth time interval information is G m =T m+1 -N m When timer m is updated from the current system time information N m , timing starts, the timing time is the mth time interval information G m When timer m calls the time update function updatetime, the remaining time information L m Reduce by 1 second, then L m -1 second is zero second. At this point, the countdown ends.
[0064] It should be noted that the above current system time information N m Greater than or equal to T m , when m=1, N m Equal to T m , when m is greater than 1, N m Greater than T m . Because N m Greater than or equal to T m Each time the remaining time information is updated, an update error will be generated. In order to eliminate the update error generated by the last update of the remaining time information, the time interval information G from the last update of the remaining time information to the current update of the remaining time information is m Adjust to less than 1 second. That is, the time interval between two consecutive updates of the remaining time information is shortened, and the next update of the remaining time information is performed within a time interval of less than 1 second to compensate for the error between the current system time information and the expected time information of the remaining time information updated this time, thereby improving the countdown accuracy.
[0065] Figure 3 The block diagram of a device for processing time information according to an exemplary embodiment is shown. The device may specifically include the following units.
[0066] The first time acquisition unit 31 is configured to execute acquisition of remaining time information in the countdown page;
[0067] The second time acquisition unit 32 is configured to acquire the time interval information between two adjacent updates of the remaining time information and the expected time information of this update of the remaining time information;
[0068] The time interval adjustment unit 33 is configured to compare the current system time information with the expected time information, and adjust the time interval information to a preset interval according to the comparison result;
[0069] The remaining time updating unit 34 is configured to update the remaining time information according to the adjusted time interval information.
[0070] In an exemplary embodiment of the present disclosure, the second time acquisition unit 32 is configured to obtain the time interval information by subtracting the current system time information from the expected time information for the next update of the remaining time information.
[0071] In an exemplary embodiment of the present disclosure, the second time acquisition unit 32 is configured to generate the expected time information according to the initial time information and the time threshold information;
[0072] The initial time information indicates the time point when the remaining time information is updated for the first time.
[0073] In an exemplary embodiment of the present disclosure, the second time acquisition unit 32 is configured to add the initial time information to the time threshold information to obtain the expected time information.
[0074] In an exemplary embodiment of the present disclosure, the time interval adjustment unit 33 is configured to adjust the time interval information to the preset interval when the comparison result indicates that the current system time information is greater than the expected time information, and the preset interval represents an interval greater than zero and less than the time threshold information, and the time threshold information represents the unit time for updating the remaining time information this time.
[0075] In an exemplary embodiment of the present disclosure, the remaining time updating unit 34 includes:
[0076] an update creation unit, configured to update the current system time information and create a new timer after the remaining time information is updated;
[0077] The timing update unit is configured to perform a timing operation using the new timer, and when the timing time is the adjusted time interval information, update the remaining time information using the timing time of the new timer.
[0078] In an exemplary embodiment of the present disclosure, the timing update unit is configured to update the remaining time information to a time information difference between the remaining time information and the time threshold information when the timing time of the new timer is the adjusted time interval information.
[0079] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0080] Figure 4 4 is a block diagram of a time information processing electronic device 400 according to an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0081] Reference Figure 4 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0082] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method for processing time information. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0083] The memory 404 is configured to perform storage of various types of data to support operations on the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, images, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0084] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 400.
[0085] The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the electronic device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0086] The audio component 410 is configured to perform output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to perform receiving external audio signals. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0087] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0088] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of the components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component of the electronic device 400, the presence or absence of contact between the user and the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0089] The communication component 416 is configured to perform a wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0090] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned time information processing method.
[0091] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of an electronic device 400 to complete the above-mentioned time information processing method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0092] In an exemplary embodiment, a computer program product is also provided, the computer program product includes a computer program, the computer program can be executed by the processor 420 of the electronic device 400 to complete the above-mentioned time information processing method. Optionally, the computer program can be stored in a computer-readable storage medium of the electronic device 400, and the computer-readable storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0093] Figure 5 is a block diagram of an electronic device 500 for processing time information according to an exemplary embodiment. For example, the electronic device 500 may be provided as a server. Figure 5 The electronic device 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions that can be executed by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the above-mentioned time information processing method.
[0094] The electronic device 500 may also include a power supply component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to perform connecting the electronic device 500 to a network, and an input / output (I / O) interface 558. The electronic device 500 may operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0095] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0096] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for processing time information, characterized in that: include: Get the remaining time information in the countdown page; Acquire the time interval information between two adjacent updates of the remaining time information, and the expected time information of this update of the remaining time information; Comparing the current system time information with the expected time information, and adjusting the time interval information to a preset interval according to the comparison result; updating the remaining time information according to the adjusted time interval information; The step of adjusting the time interval information to a preset interval according to the comparison result includes: When the comparison result indicates that the current system time information is greater than the expected time information, adjusting the time interval information to the preset interval, the preset interval represents an interval greater than zero and less than the time threshold information, and the time threshold information represents the unit time of this update of the remaining time information; The updating of the remaining time information according to the adjusted time interval information includes: After the remaining time information is updated, the current system time information is updated and a new timer is created; The new timer is used to perform a timing operation, and when the timing time is the adjusted time interval information, the remaining time information is updated using the timing time of the new timer.
2. The method according to claim 1, characterized in that The obtaining of the time interval information between two adjacent updates of the remaining time information includes: The time interval information is obtained by subtracting the current system time information from the expected time information for the next update of the remaining time information.
3. The method according to claim 1, characterized in that The obtaining of the expected time information of the remaining time information for this update includes: Generate the expected time information according to the initial time information and the time threshold information; The initial time information indicates the time point when the remaining time information is updated for the first time.
4. The method according to claim 3, characterized in that The generating the expected time information according to the initial time information and the time threshold information includes: The initial time information is added to the time threshold information to obtain the expected time information.
5. The method according to claim 1, characterized in that When the timing time is the adjusted time interval information, updating the remaining time information by using the timing time of the new timer includes: When the timing time of the new timer is the adjusted time interval information, the remaining time information is updated to be the time information difference between the remaining time information and the time threshold information.
6. A time information processing device, characterized in that: include: A first time acquisition unit is configured to execute acquisition of remaining time information in a countdown page; A second time acquisition unit is configured to acquire time interval information between two adjacent updates of the remaining time information and expected time information for this update of the remaining time information; A time interval adjustment unit, configured to compare the current system time information with the expected time information, and adjust the time interval information to a preset interval according to the comparison result; a remaining time updating unit, configured to update the remaining time information according to the adjusted time interval information; The time interval adjustment unit is configured to adjust the time interval information to the preset interval when the comparison result indicates that the current system time information is greater than the expected time information, wherein the preset interval indicates an interval greater than zero and less than the time threshold information, and the time threshold information indicates the unit time of the current update of the remaining time information; The remaining time updating unit comprises: an update creation unit, configured to update the current system time information and create a new timer after the remaining time information is updated; The timing update unit is configured to perform a timing operation using the new timer, and when the timing time is the adjusted time interval information, update the remaining time information using the timing time of the new timer.
7. The device according to claim 6, characterized in that The second time acquisition unit is configured to obtain the time interval information by subtracting the current system time information from the expected time information for the next update of the remaining time information.
8. The device according to claim 6, characterized in that The second time acquisition unit is configured to generate the expected time information according to the initial time information and the time threshold information; The initial time information indicates the time point when the remaining time information is updated for the first time.
9. The device according to claim 8, characterized in that The second time acquisition unit is configured to add the initial time information to the time threshold information to obtain the expected time information.
10. The device according to claim 6, characterized in that The timing update unit is configured to execute, when the timing time of the new timer is the adjusted time interval information, updating the remaining time information to the time information difference between the remaining time information and the time threshold information.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for processing time information as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for processing time information as claimed in any one of claims 1 to 5.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for processing time information according to any one of claims 1 to 5 is implemented.
