Time calling method, device and equipment, timing method and storage medium

By selecting an external clock or an internal clock to obtain the target time, the problem of precise control of Windows system timers in audio and video processing is solved, and precise time regulation and reasonable resource allocation are achieved.

CN119201369APending Publication Date: 2024-12-27GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310760354.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2024-12-27

Smart Images

  • Figure CN119201369A_ABST
    Figure CN119201369A_ABST
Patent Text Reader

Abstract

The invention discloses a time calling method, device and equipment, a timing method and a storage medium, and the time calling method is used for electronic equipment, and comprises the steps: obtaining a clock type required by a target task of the electronic equipment, the clock type comprises an external clock and an internal clock, the internal clock communicates with the internal part of the electronic equipment, and the external clock communicates with the internal part of the electronic equipment; the external clock is in external communication with the electronic equipment through a pre-configured proxy server, and the time precision of the external clock is higher than that of the internal clock; when the clock type required by the target task of the electronic equipment is an internal clock, obtaining target time through the internal clock; and when the clock type required by the target task of the electronic equipment is an external clock, obtaining target time through the external clock. According to the technical scheme provided by the invention, the problem that accurate control cannot be realized during audio and video processing can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of time control technology, and in particular to a time calling method, device and equipment, a timing method and a storage medium. Background Art

[0002] Timer is a common and necessary technology in software development. Timer is a collection of functions. By using the methods provided by it, the software can complete the specified function within a fixed time. Its purpose is to make the software automatically perform a certain operation or task within a fixed time.

[0003] In the related art, when a timer is running based on a Windows system, the timer often calls the system clock to obtain the current time. However, the accuracy of the system clock is generally low, and its jitter is relatively serious, resulting in the inability to accurately control when processing audio and video. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a time calling method, device and equipment, a timing method and a storage medium, which can solve the problem that the related technology cannot accurately control when processing audio and video. To achieve the above purpose, the technical solution provided by the embodiments of the present application is as follows:

[0005] In a first aspect, a time calling method is provided for an electronic device, comprising: obtaining a clock type required for a target task of the electronic device, the clock type comprising an external clock and an internal clock, the internal clock communicating with the electronic device internally, the external clock communicating with the electronic device externally via a preconfigured proxy server, the time accuracy of the external clock being higher than the time accuracy of the internal clock; when the clock type required for the target task of the electronic device is the internal clock, obtaining the target time through the internal clock; when the clock type required for the target task of the electronic device is the external clock, obtaining the target time through the external clock.

[0006] In a second aspect, a timing method is provided, comprising:

[0007] Obtaining the current initial time; wherein, when this is the first time, obtaining the first initial time by the method described in the first aspect; when this is not the first time, the current initial time is the previous target time;

[0008] Get the target cycle;

[0009] The current theoretical time is obtained, where the current theoretical time is the sum of the target period times the current number and the first initial time;

[0010] Obtaining the current calibration period, wherein the current calibration period is the difference between the current theoretical time and the current initial time;

[0011] At intervals of the current calibration period, the current target time is obtained by the method described in the first aspect.

[0012] In a third aspect, a time calling device is provided for an electronic device, comprising: an acquisition module, used to acquire the clock type required for a target task of the electronic device; wherein the clock type includes an external clock and an internal clock, the internal clock communicates with the electronic device internally, the external clock communicates with the electronic device externally through a preconfigured proxy server, and the time accuracy of the external clock is higher than the time accuracy of the internal clock; a processing module, used to acquire the target time through the internal clock when the clock type required for the target task of the electronic device is the internal clock; and used to acquire the target time through the external clock when the clock type required for the target task of the electronic device is the external clock.

[0013] According to a fourth aspect, an electronic device is provided, comprising a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method described in the first aspect.

[0014] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0015] The method for time calling provided in the embodiment of the present application can select one of the external clock and the internal clock to obtain the target time. Among them, the internal clock communicates with the internal part of the electronic device, the external clock communicates with the external part of the electronic device, and the time accuracy of the external clock is higher than that of the internal clock. When the target task of the electronic device has high requirements for the accuracy of the clock, the time can be obtained through the external clock to accurately control the time of the electronic device. When the target task of the electronic device has low requirements for the accuracy of the clock, the time can be obtained through the internal clock to facilitate the rational allocation of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A flowchart of a time calling method provided in an embodiment of the present application;

[0018] Figure 2An architecture diagram of an electronic device, a proxy server, and an external clock provided in an embodiment of the present application;

[0019] Figure 3 A schematic diagram of the structure of a time calling device provided in an embodiment of the present application;

[0020] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The terms "first" and "second" etc. in the specification, claims and the above-mentioned drawings of the embodiments of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0022] It should be understood that the term "and / or" used in this article is only a way to describe the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. " / " means the relationship of "or".

[0023] As described in the background art, the accuracy of the system clock in the related art is generally low, and its jitter is relatively serious, resulting in the problem that the timer using the system clock cannot be accurately controlled when processing audio and video.

[0024] In response to the above technical problems, the embodiments of the present application provide a time calling method, apparatus and device. When the electronic device has high requirements for clock accuracy, time can be obtained through an external clock to accurately control the time of the electronic device.

[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0026] Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0027] First, the execution subject of the time calling method provided in the embodiment of the present application can be an electronic device with a calling time requirement. The electronic device can be in various forms, such as an access terminal, a user unit, a user station, a mobile station, a mobile station (MS for short), a remote station, a remote terminal, a mobile device, a terminal equipment (terminal equipment), a wireless communication device, a user agent or a user device. It can also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA for short), a handheld device with wireless communication function, a computing device or other processing equipment connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a future 5G network or a terminal device in a future evolving Public Land Mobile Network (PLMN for short), etc. The embodiment of the present application is not limited to this, as long as the electronic device can communicate with an internal clock or an external clock.

[0028] The internal clock can be a soft clock (system clock) or a hard clock configured inside the electronic device, and the internal clock can communicate internally with the electronic device. For example, when the electronic device is a computer, the hard clock is a physical clock set on the computer motherboard. The hard clock will not stop running due to power failure or computer shutdown. The operation of the hard clock mainly depends on the operation of the power supply module (such as button batteries, etc.) on the computer motherboard; the soft clock can be the time displayed on the computer's display screen. The soft clock is initialized by the hard clock when the computer is turned on, and synchronized with the network clock through NTP (Network Time Protocol) after the computer is turned on. In the Windows system, the soft clock can be synchronized with the network clock at regular intervals.

[0029] The electronic device can use an API (Application Programming Interface) function to obtain the time of the soft clock or the hard clock. The API function for obtaining the local time is GetLocalTime, and the API function for obtaining the Coordinated Universal Time (UTC) is GetSystemTime. In other words, the electronic device can directly communicate with the internal clock.

[0030] The external clock can be a clock that is independent of the electronic device, and the time accuracy of the external clock is higher than that of the internal clock. For example, the time accuracy of the internal clock is at the ms (millisecond) level, and the time accuracy of the external clock can be at the sub-millisecond, μs (microsecond) level, or ns (nanosecond) level.

[0031] The external clock can be a high-precision network clock and / or a hardware clock. Among them, the high-precision network clock may include a PTP clock, a GPS clock, etc. Among them, the GPS (Global Positioning System) clock is a high-precision, large-capacity clock product that supports NTP / SNTP (Simple Network Time Protocol). The high-precision clock of the GPS clock is directly derived from the atomic clocks of each satellite in the Beidou system and the GPS system. The local clock source is tamed through signal analysis to achieve the precise maintenance function of the local clock after the satellite signal is lost. PTP (Precision Time Protocol) is a protocol for achieving network clock synchronization, which supports clock synchronization accuracy at the nanosecond level. The PTP clock can call the PTP protocol stack to implement the call to the PTP clock.

[0032] The hardware clock can be a physical high-precision clock that is set outside the electronic device and connected to the port of the electronic device. It can be an independent computer chip for storing and tracking time information. The hardware clock can be an atomic clock, such as a cesium atomic clock, a hydrogen atomic clock, a rubidium atomic clock, a CPT atomic clock, etc. The hardware clock can also be a watch, a bracelet, a clock, etc. with high time accuracy.

[0033] It is worth noting that an electronic device can run one application or multiple applications. Among multiple applications running at the same time, not all applications need to call time to run. Among multiple applications that need to call time, the time accuracy required by different applications may be the same or different. In addition, an application may have one target task, or an application may have multiple target tasks, and the time accuracy of each target task may be the same or different. For example: the application is: timer. The first target task is: timing for 1 minute, and the time accuracy of the target task is s; the second target task is: timing for 4ms, and the time accuracy of the target task is ms; the third target task is: timing for 5μs, and the time accuracy of the target task is μs.

[0034] If the target task (such as video editing) has high requirements for time accuracy, an external clock can be used to obtain time for accurate time control; if the target task (such as daily alarm reminder) has low requirements for time accuracy, an internal clock can be used to obtain time in order to reduce the memory usage of the electronic device. Therefore, when the electronic device runs the target task, it is necessary to first determine whether the target task needs to call the internal time or the external time.

[0035] Figure 1 is a flow chart of the time calling method provided by the embodiment of the present application. Figure 1 , the time calling method may include:

[0036] S100, obtaining a clock type required for a target task of the electronic device;

[0037] S200, when the clock type required by the target task of the electronic device is an internal clock, obtaining the target time through the internal clock;

[0038] S300: When the clock type required by the target task of the electronic device is an external clock, obtain the target time through the external clock.

[0039] The clock type includes an external clock and an internal clock. The method for obtaining the clock type required for the target task of the electronic device may be: searching for the clock type required for the target task through a preset first corresponding relationship.

[0040] Specifically, step S100 may include: S111, acquiring the attribute information of the target task and the first corresponding relationship; S112, determining the clock type corresponding to the attribute information of the target task according to the attribute information of the target task and the first corresponding relationship; S113, when the clock type corresponding to the attribute information of the target task is an internal clock, the internal clock is the clock type required for the target task of the electronic device; when the clock type corresponding to the attribute information of the target task is an external clock, the external clock is the clock type required for the target task of the electronic device. In other words, the clock type corresponding to the attribute information of the target task is the clock type required for the target task of the electronic device.

[0041] Among them, the attribute information of the target task may include at least one of the following: the name of the target task, the usage category of the target task, and the time accuracy category required by the target task. For example, the name of the target task is: video audio and video synchronization, the usage category of the target task (video audio and video synchronization) is: video editing category, and the time accuracy category of the target task (video audio and video synchronization) is: high time accuracy; for another example, the name of the target task is: alarm reminder. The usage category of the target task (alarm reminder) is: basic function category, and the time accuracy category of the target task (alarm reminder) is: low time accuracy. It should be noted that there can be at least two time accuracy categories, and the above text takes the two categories of high time accuracy and low time accuracy as examples. Of course, when the external clock includes a variety of classified clocks of different time magnitudes as described below, the number of time accuracy categories will be more than two.

[0042] In addition, the first correspondence may characterize the relationship between the attribute information of the target task and the clock type. For example, "video audio and video synchronization" corresponds to "external clock", which can also be expressed as the clock type corresponding to "video audio and video synchronization" is "external clock". In addition, there may be at least two groups of correspondences in the first correspondence. In the first correspondence, the attribute information of multiple target tasks may correspond to multiple clock types one by one, or the attribute information of several task targets may correspond to a certain clock type.

[0043] It should be noted that each set of corresponding relationships in the first corresponding relationship may be established in the implementation scenario of the first execution of the target task identified by the corresponding server. For example, the corresponding relationship between "video and audio synchronization" and "external clock" is established in the scenario of the first execution of the target task "video and audio synchronization".

[0044] Based on this, in step S100, obtaining the clock type required for the target task of the electronic device also includes: S114, obtaining the number of executions of the target task, and judging whether the target task is executed for the first time according to the number of executions of the target task. For example, when the number of executions of the target task is 0, it is judged that the target task is executed for the first time. When the number of executions of the target task is n (n is a positive integer greater than or equal to 1), it is judged that the target task is not executed for the first time.

[0045] S115, when the target task is executed for the first time, determining whether there is a corresponding relationship between the target task executed for the first time and the clock type in the first corresponding relationship;

[0046] S116: When the first corresponding relationship does not contain the corresponding relationship between the target task executed for the first time and the clock type, supplement the corresponding relationship between the target task executed for the first time and the clock type.

[0047] Among them, in step S116, supplementing the correspondence between the target task executed for the first time and the clock type may include the following methods:

[0048] In one possible supplementation method, S1161, the user may be asked about the clock type corresponding to the target task, and the first corresponding relationship may be supplemented according to the query result.

[0049] Specifically, after obtaining the query result, the correspondence between the target task executed for the first time and the clock type selected by the user is stored in the first correspondence. For example, when target task 1 is executed for the first time and the clock type corresponding to target task 1 is not stored in the first correspondence, the user may be asked which clock type is selected for target task 1 by means of a pop-up window, voice, etc. After the user selects an external clock, the correspondence between the target task and the external clock is stored in the first correspondence.

[0050] In another possible supplementary method, S1162, based on the attribute information of the target task executed for the first time, find the related tasks related to the target task executed for the first time in the first relationship; obtain the clock type corresponding to the related task according to the first corresponding relationship; the clock type corresponding to the related task is the recommended clock, and the recommended clock is recommended to the user; when the user selects the recommended clock to obtain the target time, the correspondence between the target task executed for the first time and the recommended clock is stored in the first corresponding relationship; when the user does not select the recommended clock to obtain the time but selects other clocks that are not the recommended clocks, the correspondence between the target task and the other clocks selected by the user is stored in the first corresponding relationship.

[0051] For example: when target task 2 is executed for the first time, and the clock type corresponding to target task 2 is not stored in the first correspondence, the application information of the target task can be found online or locally on the electronic device to determine the usage category of the target task. For example, the usage category of target task 2 is "video editing category". In the first correspondence, the usage category of "video and audio synchronization" is "video editing category", and the clock type corresponding to "video and audio synchronization" is "external clock". The "external clock" can be recommended to the user as the recommended clock mentioned above. If the user chooses to use an external clock to obtain the time, the correspondence between target task 2 and the external clock is stored in the first correspondence; if the user chooses the internal clock, the correspondence between target task 2 and the internal clock is stored in the first correspondence.

[0052] It should be noted that after obtaining the recommended clock, it is also possible not to recommend it to the user, but to directly store the correspondence between the target clock and the recommended clock in the first correspondence. In addition, the above mentioned method is to supplement the correspondence of the target task executed for the first time in the first correspondence. Of course, the user can also modify the correspondence between the target task and the clock type in the first correspondence at any time.

[0053] Optionally, the external clock may include multiple classification clocks, and the time accuracy of the multiple classification clocks may be different. For example, the external clock may include classification clock 1, classification clock 2, and classification clock 3, wherein the time accuracy of classification clock 1 is 1 μs, the time accuracy of classification clock 2 is 0.1 μs, and the time accuracy of classification clock 3 is ns.

[0054] Wherein, when the clock type corresponding to the attribute information of the target task is an external clock, the external clock is the clock type required for the target task of the electronic device and may include: when the clock type corresponding to the attribute information of the target task is one of the classified clocks, the target time is obtained through one of the classified clocks. In this way, the external clock is further refined and classified to facilitate more accurate acquisition of the target time.

[0055] The external clock is a clock set outside the electronic device. Therefore, before the electronic device calls the external clock, it is necessary to first establish a proxy server to achieve communication between the electronic device and the external clock.

[0056] The method for establishing a proxy server may be as follows:

[0057] S101. Obtain application information of an external clock; wherein the application information of the external clock may be one or more of the following: a device number of the external clock, an IP (Internet Protocol) address of the external clock, and a MAC (Media Access Control Address) of the external clock.

[0058] S102, obtaining application information of the electronic device; wherein the application information of the electronic device may be one or more of the following: a device number of the electronic device, an IP address of the electronic device, and a MAC address of the electronic device.

[0059] S103: Building a proxy server between the electronic device and the external clock according to the application information of the external clock and the application information of the electronic device.

[0060] Figure 2 : is a diagram of the architecture between the electronic device, the proxy server and the external clock provided by the embodiment of the present application. Figure 2 , the proxy server 700 is a server between the electronic device 600 and the external clock 800. When the electronic device 600 obtains the time, it does not send a request to the external clock directly, but sends a request to the proxy server 700. The proxy server 700 retrieves the data required by the electronic device 600 from the external clock and transmits it to the electronic device 600, so that the proxy server 700 can monitor the communication data between the electronic device 600 and the external clock. The proxy server 700 can be a driver installed in the electronic device 600, which can have functions such as initialization and data transmission.

[0061] Among them, when the external clock is a high-precision network clock, the proxy server can be a software driver that can contact the external clock through a certificate (such as a license, proxy certificate, etc.). In this process, the external clock will verify the user's user ID, pass the certificate and other information. In terms of grid trust, the user ID is equivalent to the user's handwritten signature, which is concise and clear. The user's proxy in the information database is time-limited, generally with a life span of one week. Of course, the user can change the length of the cycle and cancel the proxy anytime and anywhere. The call of PTP clock and GPS clock depends on the network environment, so the stability and reliability of the network must be guaranteed during use to avoid errors.

[0062] When the external clock is a hardware clock, the proxy server can be a software driver that can communicate with the hardware clock and control the hardware clock to perform read and write operations. The proxy server can help the application (operating system and / or other application) of the electronic device to obtain accurate time information. The proxy server can be provided by the manufacturer and can be installed in the system of the electronic device and interact with the application of the electronic device.

[0063] Optionally, in step S300, when the clock type required by the target task of the electronic device is an external clock, the method for obtaining the target time through the external clock may include:

[0064] S310: Capture the external time sent in real time by the external clock through a pre-configured proxy server, and use the external time as the target time.

[0065] refer to Figure 2 Specifically, the external clock 800 sends the external time to the proxy server 700 in real time, and the proxy server 700 receives the external time sent by the external clock 800; the electronic device 600 sends a time acquisition request to the proxy server 700, and the proxy server 700 receives the time acquisition request and sends the external time received from the external clock 800 to the electronic device 600; the electronic device 600 receives the external time sent by the proxy server 700 and uses the external time as the target time.

[0066] Optionally, for archiving records, after receiving the external time sent by the external clock, the proxy server may fill the external time into the schedule. In addition, in order to reduce the amount of storage space occupied, the current external time may be used to replace the previous external time when the current external time is filled into the schedule. Alternatively, the proxy server may store N (a positive integer of N ≥ 2) digits of external time, and the latest external time is entered at the end of the schedule. When the latest external time is entered at the end of the schedule, the first external time in the schedule is deleted, and the external time in other digits of the schedule may fill in the gaps.

[0067] For example, the schedule can store 4 external time digits, namely: the first external time digit is 1μs, the second external time digit is 2μs, the third external time digit is 3μs, and the fourth external time digit is 4μs. When the latest external time digit of 5μs is entered into the schedule, the first external time digit of 1μs is deleted, and the first external time digit is changed to 2μs, the second external time digit is changed to 3μs, the third external time digit is changed to 4μs, and the fourth external time digit is changed to 5μs.

[0068] An embodiment of the present application also provides a timing method, which includes the time calling method mentioned above.

[0069] Optionally, the timing method may include:

[0070] S401, obtaining the current initial time; wherein, if this is the first time, the first initial time is obtained by the time calling method mentioned above; if this is not the first time, the current initial time is the last target time;

[0071] S402, obtaining a target period;

[0072] S403, obtaining the current theoretical time, which is the sum of the target period times the current number and the first initial time;

[0073] S404, obtaining the current calibration period, where the current calibration period is the difference between the current theoretical time and the current initial time;

[0074] S405. After this calibration cycle, obtain this target time by the time calling method mentioned above.

[0075] For example, in the field of audio and video, timers have high requirements for time accuracy. For such timers, the timing method may be: obtaining the first initial time and the current target time through an external clock, and obtaining the interval calibration period through an internal clock.

[0076] For example, when this is the first time, the first initial time obtained by the external clock is: 1s, and the obtained target period is: 10s;

[0077] The theoretical time obtained this time is: the sum of 1 times the target period 10s and the first initial time 1s is 11s;

[0078] The obtained calibration period is: the difference between the theoretical time 11s and the initial time 1s is 10s;

[0079] After the internal clock of the electronic device counts this calibration cycle for 10 seconds, the target time obtained through the external clock is 9 seconds;

[0080] When this is the second time, the initial time is: the last target time 9s, and the target period is: 10s;

[0081] The theoretical time obtained this time is: the sum of 2 times 10s and the first initial time 1s is 21s;

[0082] The obtained calibration period is: the difference between the theoretical time 21s and the initial time 9s is 12s;

[0083] After the internal clock of the electronic device times the current calibration cycle for 12 seconds, the external clock is used to obtain the current target time of 21 seconds. Thus, by using the external clock to obtain the time, compared with the related art using the internal clock to obtain the time, the timing has the advantage of being more accurate.

[0084] Figure 3 This is a schematic diagram of the structure of the time calling device provided in the embodiment of the present application. Figure 3 , the embodiment of the present application may also provide a time calling device 500, which is used in an electronic device and includes an acquisition module 510 and a processing module 520, wherein the acquisition module 510 can be used to obtain the clock type required for the target task of the electronic device. The clock types include external clocks and internal clocks, the internal clock communicates with the electronic device internally, the external clock communicates with the electronic device externally through a pre-configured proxy server, and the time accuracy of the external clock is higher than the time accuracy of the internal clock. The processing module 520 can be used to obtain the target time through the internal clock when the clock type required for the target task of the electronic device is the internal clock; and to obtain the target time through the external clock when the clock type required for the target task of the electronic device is the external clock.

[0085] Optionally, the acquisition module 510 can obtain the attribute information of the target task and the first correspondence from the user, wherein the first correspondence is used to characterize the correspondence between the attribute information of the target task and the clock type. The acquisition module 510 can determine the clock type corresponding to the attribute information of the target task according to the attribute information of the target task and the first correspondence. When the clock type corresponding to the attribute information of the target task is an internal clock, the acquisition module 510 can determine that the internal clock is the clock type required for the target task of the electronic device; when the clock type corresponding to the attribute information of the target task is an external clock, the acquisition module 510 can determine that the external clock is the clock type required for the target task of the electronic device.

[0086] Among them, the acquisition module 510 acquires the clock type required by the target task of the electronic device and may also include: acquiring the number of executions of the target task, and judging whether the target task is executed for the first time according to the number of executions of the target task. And when the target task is executed for the first time, the acquisition module 510 may judge whether there is a corresponding relationship between the target task executed for the first time and the clock type in the first corresponding relationship; if there is no corresponding relationship between the target task executed for the first time and the clock type in the first corresponding relationship, the acquisition module 510 may supplement the corresponding relationship between the target task executed for the first time and the clock type.

[0087] The acquisition module 510 may supplement the correspondence between the target task executed for the first time and the clock type in the following ways:

[0088] In one of the ways, the acquisition module 510 may inquire the user about the clock type corresponding to the target task executed for the first time, and supplement the first corresponding relationship according to the inquiry result.

[0089] In another manner, the acquisition module 510 can find related tasks related to the target task executed for the first time in the first relationship based on the attribute information of the target task executed for the first time, and obtain the clock type corresponding to the related task based on the first corresponding relationship; the clock type corresponding to the related task is the recommended clock, and the recommended clock is recommended to the user; when the user selects the recommended clock to obtain the target time, the correspondence between the target task executed for the first time and the recommended clock is stored in the first corresponding relationship.

[0090] Optionally, the external clock may include multiple classified clocks, and the time accuracy levels of the multiple classified clocks may be different. When the clock type corresponding to the attribute information of the target task is an external clock, the acquisition module 510 may include: when the clock type corresponding to the attribute information of the target task is one of the classified clocks, acquiring the target time through one of the classified clocks.

[0091] Optionally, when the clock type required by the target task of the electronic device is an external clock, the processing module 520 can obtain the target time through the external clock in the following way: the processing module 520 can capture the external time sent in real time by the external clock through a pre-configured proxy server, and can use the external time as the target time.

[0092] It should be noted that, when the time calling device 500 provided in the above embodiment executes the time calling method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the time calling device 500 provided in the above embodiment and the time calling method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0093] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 The embodiment of the present application may also provide an electronic device 600, which may include a processor 610 and a memory 620; wherein the memory 610 stores a computer program, and the computer program is suitable for being loaded by the processor 610 and executing the time call method mentioned above.

[0094] The processor 620 may include one or more processing units, for example, the processor 620 may be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), etc. A general processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly implemented as a hardware processor, or may be implemented as a combination of hardware and software modules in the processor.

[0095] The memory 610 can be used to store program instructions. The memory 610 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 600 (such as audio data, etc.), etc. In addition, the memory 610 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (universal flash storage, referred to as: UFS), etc. The processor 620 executes various functional applications and data processing of the electronic device 600 by running the program instructions stored in the memory 610.

[0096] Optionally, the electronic device 600 may also include a communication module that can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 600. The communication module can receive electromagnetic waves by an antenna, filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The communication module can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some of the functional modules of the communication module can be set in the processor 620. In some embodiments, at least some of the functional modules of the communication module can be set in the same device as at least some of the modules of the processor 620.

[0097] Optionally, the electronic device 600 further includes: a camera and / or a display screen, etc. The camera can shoot images or videos. For example, the camera can shoot videos under the control of the processor 620 and store the videos in the memory 610. The display screen is used to display images, videos, etc. The display screen includes a display panel. The display panel can use a liquid crystal display (Liquid Crystal Display, referred to as LCD), an organic light-emitting diode (Organic Light-Emitting Diode, referred to as OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (Active-Matrix Organic Light Emitting Diode, referred to as AMOLED), a flexible light-emitting diode (Flex Light-Emitting Diode, referred to as FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (Quantum Dot Light Emitting Diodes, referred to as QLED), etc. In some embodiments, the electronic device 600 may include 1 or N display screens, where N is a positive integer greater than 1. The display panel can receive touch operations input by a user through a finger or an input device. The input device includes but is not limited to: a stylus pen, an infrared pen and / or a capacitive pen, etc.

[0098] It should be noted that the number of memories 610 and processors 620 is not limited in the embodiments of the present application, and they can be one or more; the memories 610 and processors 620 can be connected by wire or wireless in a variety of ways, such as through a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0099] The electronic device of this embodiment can be used to execute the technical solution in the above method embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.

[0100] The embodiment of the present application may also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the time calling method mentioned above is implemented.

[0101] In the above-mentioned embodiments, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0102] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0103] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.

[0104] The above storage medium 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, etc. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0105] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A time calling method, used in electronic equipment, characterized in that: include: Acquire a clock type required for a target task of the electronic device, the clock type comprising an external clock and an internal clock, the internal clock communicates with the electronic device internally, the external clock communicates with the electronic device externally via a preconfigured proxy server, and the time accuracy of the external clock is higher than the time accuracy of the internal clock; When the clock type required by the target task of the electronic device is an internal clock, the target time is obtained through the internal clock; when the clock type required by the target task of the electronic device is an external clock, the target time is obtained through the external clock.

2. The method according to claim 1, characterized in that The clock type required for obtaining the target task of the electronic device includes: Acquire the attribute information of the target task and a first corresponding relationship, wherein the first corresponding relationship is used to characterize the corresponding relationship between the attribute information of the target task and the clock type; Determining a clock type corresponding to the attribute information of the target task according to the attribute information of the target task and the first corresponding relationship; When the clock type corresponding to the attribute information of the target task is an internal clock, the internal clock is the clock type required for the target task of the electronic device; when the clock type corresponding to the attribute information of the target task is an external clock, the external clock is the clock type required for the target task of the electronic device.

3. The method according to claim 2, characterized in that The step of obtaining the clock type required for the target task of the electronic device further includes: Obtaining the number of executions of the target task, and judging whether the target task is executed for the first time according to the number of executions of the target task; When the target task is executed for the first time, determining whether there is a corresponding relationship between the target task executed for the first time and the clock type in the first corresponding relationship; When the first corresponding relationship does not contain the corresponding relationship between the target task and the clock type executed for the first time, the corresponding relationship between the target task and the clock type executed for the first time is supplemented.

4. The method according to claim 3, characterized in that The correspondence between the target task executed for the first time and the clock type includes: Inquiring the user about the clock type corresponding to the target task executed for the first time, and supplementing the first corresponding relationship according to the inquiry result; Or, based on the attribute information of the target task executed for the first time, find the related tasks related to the target task executed for the first time in the first relationship, and obtain the clock type corresponding to the related task according to the first corresponding relationship; the clock type corresponding to the related task is the recommended clock, and the recommended clock is recommended to the user; when the user selects the recommended clock to obtain the target time, the correspondence between the target task executed for the first time and the recommended clock is stored in the first corresponding relationship.

5. The method according to any one of claims 1 to 4, characterized in that: The external clock includes multiple classified clocks, and the time accuracy of the multiple classified clocks is different in magnitude; When the clock type corresponding to the attribute information of the target task is an external clock, the external clock is a clock type required by the target task of the electronic device, including: When the clock type corresponding to the attribute information of the target task is one of the classified clocks, the target time is acquired through one of the classified clocks.

6. The method according to claim 1, characterized in that When the clock type required by the target task of the electronic device is an external clock, obtaining the target time through the external clock includes: The external time sent in real time by the external clock is captured by the pre-configured proxy server, and the external time is used as the target time.

7. A timing method, characterized in that: include: Obtaining the current initial time; wherein, when this is the first time, obtaining the first initial time by the method described in any one of claims 1 to 6; when this is not the first time, the current initial time is the last target time; Get the target cycle; The current theoretical time is obtained, where the current theoretical time is the sum of the target period times the current number and the first initial time; Obtaining the current calibration period, wherein the current calibration period is the difference between the current theoretical time and the current initial time; The target time is obtained by the method described in any one of claims 1 to 6 during the calibration period.

8. A time calling device, used in electronic equipment, characterized in that: include: an acquisition module, configured to acquire a clock type required for a target task of the electronic device; wherein the clock type includes an external clock and an internal clock, the internal clock communicates with the electronic device internally, the external clock communicates with the electronic device externally via a preconfigured proxy server, and the time accuracy of the external clock is higher than the time accuracy of the internal clock; A processing module is used to obtain the target time through the internal clock when the clock type required by the target task of the electronic device is the internal clock; and is used to obtain the target time through the external clock when the clock type required by the target task of the electronic device is the external clock.

9. An electronic device, characterized in that: The method comprises a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Time synchronization method, distributed network system, electronic equipment, medium and product

    CN122052966A