System and method for time synchronization
By designing power regulation, communication and processing systems in electronic devices, and using NTP protocol to communicate with power-receiving accessories and servers, the problem of time information loss of electronic devices after power disconnection is solved, and rapid recovery and accurate time synchronization is achieved.
Patent Information
- Application Number
- CN202410651902.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-08-07
- Filing Date
- 2024-05-24
- Publication Date
- 2024-11-26
AI Technical Summary
When the power supply is disconnected or unavailable, time information may be lost, and it is difficult for the prior art to quickly restore accurate time information.
Design an electronic device that includes power regulation circuits, communication systems and processing systems, through communication with power receiving accessories, send and receive time update requests and information using Network Time Protocol (NTP), update internal clocks, and if necessary, from the outside The NTP server obtains time updates to ensure time synchronization.
It realizes that electronic devices quickly obtain accurate time information after reconnecting or restoring the power supply, ensuring the reliability and accuracy of time synchronization, and avoiding the loss of time information.
Smart Images

Figure CN119030647A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to and the benefit of U.S. Provisional Application No. 63 / 504,092, filed on May 24, 2023, and entitled “Systems and Methods of Time Synchronization,” which is hereby incorporated by reference in its entirety for all purposes. Background Art
[0003] An electronic device may use a power source (such as a battery) that may be disconnected from the device or may otherwise become unavailable due to being substantially fully discharged or other reasons. Such a disconnection or unavailability event may result in a reset / restart of the electronic device, which may also result in a loss of accurate time information. However, accurate time information is useful and may even be required in some cases for certain tasks performed by the electronic device. Summary of the invention
[0004] For such applications, it may be desirable to provide an electronic device and associated systems and methods that may allow the device to quickly obtain accurate time information once power is reconnected or otherwise restored.
[0005] An electronic device may include: a power conditioning circuit that receives power from a powered accessory; a first communication system that communicates with the powered accessory; an internal clock; and a first processing system that is coupled to the first communication system and the internal clock. Once the electronic device is connected to the powered accessory, the first processing system may send a first time update request to the powered accessory and may update the internal clock based on the first time update received from the powered accessory. The powered accessory may include an energy storage device that delivers power to the electronic device; a second communication system that communicates with the electronic device; a real-time clock; and a second processing system that is coupled to the second communication system and the real-time clock. Once the electronic device is connected to the powered accessory and receives a first time update request from the electronic device, the processing system may send the first time update to the electronic device. The first time update request and the first time update may be in the form of a network time protocol packet. The first time update may be in the form of a network time protocol packet.
[0006] The electronic device may also include a network interface coupled to the first processing system. The first processing system may send a second time update request to a network time protocol server via the network interface according to a network time protocol, and may receive a second time update from the network time protocol server via the network interface according to the network time protocol. The first processing system may send a third time update to the powered accessory via the first communication system. The third time update may be based on the second time update received from the network time protocol server. The second processing system may update the real-time clock based on the third time update.
[0007] An electronic device may include: a power regulation circuit that receives power from a powered accessory; a first communication system that communicates with the powered accessory; an internal clock; and a first processing system that is coupled to the first communication system and the internal clock. Once the electronic device is connected to the powered accessory, the first processing system may send a first time update request to the powered accessory and update the internal clock based on the first time update received from the powered accessory. The first time update request and the first time update may take the form of a network time protocol packet. The first time update request and the first time update may not correspond to a network time protocol. The first time update may include information about a current time, a communication delay between the electronic device and the powered accessory, and an uncertainty value of the powered accessory clock. If the uncertainty value of the powered accessory clock exceeds a threshold, the first processing system may not update the internal clock. Before sending the first time update request to the powered accessory, the first processing system may update the internal clock using an internal recovery time. The internal recovery time may be based on a file system timestamp associated with the first processing system.
[0008] The electronic device may also include a network interface coupled to the first processing system. The first processing system may send a second time update request to a network time protocol server via the network interface according to a network time protocol; receive a second time update from the network time protocol server via the network interface according to the network time protocol; and update the internal clock based on the second time update. The first processing system may send a third time update to the powered accessory via the first communication system, and the third time update may be based on the second time update received from the network time protocol server.
[0009] A powered accessory that supplies power to an electronic device may include an energy storage device that delivers power to the electronic device; a communication system that communicates with the electronic device; a real-time clock; and a processing system that is coupled to the communication system and the real-time clock. Once the electronic device is connected to the powered accessory and receives a first time update request from the electronic device, the processing system may send a first time update to the electronic device. The first time update request and the first time update are in the form of a network time protocol packet. The first time update request and the first time update may not correspond to a network time protocol. The first time update may include information about the current time, a communication delay between the electronic device and the powered accessory, and an uncertainty value of the powered accessory real-time clock. The processing system may receive a second time update from the electronic device via the communication system; and the processing system updates the real-time clock based on the second time update. The processing system may detect a reset that may affect the real-time clock, and in response thereto, the uncertainty value associated with the real-time clock may be set to a maximum value. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 A block diagram of an electronic device is shown.
[0011] Figure 2 A system is shown that includes an electronic device and an associated powered accessory that can facilitate obtaining accurate time information once power is reconnected or otherwise restored.
[0012] Figure 3 A communication and calculation sequence is shown for obtaining accurate time information once power is reconnected or otherwise restored.
[0013] Figure 4 A flow chart illustrating a technique that a powered accessory device can use to provide time information to an electronic device and / or update its own internal clock.
[0014] Figure 5 A flow chart illustrating a technique that an electronic device may use to obtain accurate time information once power is reconnected or otherwise restored. DETAILED DESCRIPTION
[0015] In the following description, for the purpose of explanation, many specific details are set forth in order to provide a thorough understanding of the disclosed concepts. As part of this description, some of the drawings in the drawings of the present disclosure represent structures and devices in block diagram form for simplicity. For the sake of clarity, not all features of actual implementations are described in the present disclosure. In addition, the language used in the present disclosure is selected for readability and instructional purposes and has not been selected to describe or limit the disclosed subject matter. Instead, the attached claims are intended for this purpose.
[0016] Various embodiments of the disclosed concepts are described by way of example, and are not limited to individual drawings, in which similar reference numerals indicate similar elements. For simplicity and clarity of description, reference numerals are repeated in different drawings to indicate corresponding or similar elements, where appropriate. In addition, many specific details are shown in order to provide a full understanding of the specific implementation described herein. In other cases, methods, procedures, and components are not described in detail to avoid blurring the related functions described. Mentioning "one", "a kind of" or "another" embodiment in this disclosure is not necessarily the same or different embodiments, and this means at least one. A given drawing may be used to illustrate more than one embodiment or more than one type of features of the present disclosure, and all elements in the drawings may not be required for a given embodiment or type. When provided in the drawings, the reference numerals refer to the same element throughout several drawings, but they may not be repeated in each drawing. Unless otherwise specified, the drawings are not drawn to scale, and the proportions of certain components may be enlarged to better illustrate the details and features of the present disclosure.
[0017] Figure 1 1 is a block diagram of an electronic device 100 according to an embodiment of the present disclosure. The electronic device 100 may include, among other things, one or more processors 101 (collectively referred to herein as a single processor for convenience, which may be implemented as any suitable form of processing circuit), a memory 102, a non-volatile storage device 103, a display 104, an input device 105, an input / output (I / O) interface 106, a network interface 107, and a power system 108. Figure 1 The various functional blocks shown may include hardware elements (including circuits), software elements (including machine executable instructions), or a combination of hardware and software elements (which may be referred to as logic). Processor 101, memory 102, non-volatile storage device 103, display 104, input device 105, input / output (I / O) interface 106, network interface 107 and / or power system 108 may each be directly or indirectly communicatively coupled to each other (e.g., through or via another component, a communication bus, a network, etc.) to transmit and / or receive data between each other. It should be noted that Figure 1 This is merely one example of a particular implementation and is intended to illustrate the types of components that may be present in electronic device 100 .
[0018] By way of example, electronic device 100 may include any suitable computing device, including a desktop or laptop computer, a portable electronic device or a handheld electronic device (such as a wireless electronic device or a smart phone), a tablet computer, a wearable electronic device, and other similar devices.
[0019] Figure 1The processor 101 and other related items in the embodiment may be completely embodied by hardware or by hardware programmed to execute appropriate software instructions. Figure 1 Other related items in the electronic device 100 may be single independent processing modules, or may be fully or partially combined in any of the other elements in the electronic device 100. The processor 101 may be implemented with a combination of a general-purpose microprocessor, a microcontroller, a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a state machine, a gated logic, a discrete hardware component, a dedicated hardware finite state machine, or any other suitable entity that can perform calculations or other manipulations of information. The processor 101 may include one or more application processors, one or more baseband processors, or both, and perform various functions described herein.
[0020] exist Figure 1 In the electronic device 100, the processor 101 may be operably coupled to the memory 102 and the non-volatile storage device 103 to execute various algorithms. Such programs or instructions executed by the processor 101 may be stored in any suitable article including one or more tangible computer-readable media. The tangible computer-readable medium may include the memory 102 and / or the non-volatile storage device 103, individually or collectively, to store instructions or routines. The memory 102 and the non-volatile storage device 103 may include any suitable article for storing data and executable instructions, such as random access memory, read-only memory, rewritable flash memory, hard drive, and optical disk. In addition, the program (e.g., operating system) encoded on such a computer program product may also include instructions that can be executed by the processor 101 to enable the electronic device 100 to provide various functions.
[0021] In some embodiments, the display 104 can facilitate a user viewing images generated on the electronic device 100. In some embodiments, the display 104 can include a touch screen that can facilitate a user to interact with a user interface of the electronic device 100. In addition, it should be understood that in some embodiments, the display 104 can include one or more liquid crystal displays (LCDs), light emitting diode (LED) displays, organic light emitting diode (OLED) displays, active matrix organic light emitting diode (AMOLED) displays, or some combination of these and / or other display technologies.
[0022] The input device 105 of the electronic device 100 can enable a user to interact with the electronic device 100 (e.g., press a button to increase or decrease the volume level). As with the network interface 107, the I / O interface 106 can enable the electronic device 100 to interact with various other electronic devices. In some embodiments, the I / O interface 106 may include an I / O port for a hardwired connection for charging and / or content manipulation using a standard connector and protocol such as a universal serial bus (USB) or other connectors and protocols. The network interface 107 may include, for example, one or more interfaces for a personal area network (PAN), such as an ultra-wideband (UWB) or Network; Local Area Network (LAN) or Wireless Local Area Network (WLAN), such as one of the IEEE802.11x series of protocols (e.g. ) networks; and / or wide area networks (WANs), such as any standards associated with the 3rd Generation Partnership Project (3GPP), including, for example, 3rd Generation (3G) cellular networks, Universal Mobile Telecommunications System (UMTS), 4th Generation (4G) cellular networks, Long Term Evolution (LET), and / or 4G cellular networks. Cellular network, Long Term Evolution Licensed Assisted Access (LTE-LAA) cellular network, 5th generation (5G) cellular network and / or new radio (NR) cellular network, 6th generation (6G) or beyond 6G cellular network, satellite network, non-terrestrial network, etc. Specifically, the network interface 107 may include, for example, one or more interfaces for using a cellular communication standard of the 5G specification including a millimeter wave (mmWave) frequency range (e.g., 24.25-300 gigahertz (GHz)) that defines and / or implements a frequency range for wireless communication. The network interface 107 of the electronic device 100 may allow communication through the aforementioned networks (e.g., 5G, Wi-Fi, LTE-LAA, etc.).
[0023] The network interface 107 may also include, for example, one or more interfaces for: a broadband fixed wireless access network (eg, ), mobile broadband wireless network (mobile ), asynchronous digital subscriber line (e.g., ADSL, VDSL), digital video terrestrial broadcasting Network and its extension DVB handheld equipment Networks, ultra-wideband (UWB) networks, alternating current (AC) power lines, etc.
[0024] The power system 108 of the electronic device 100 may include any suitable power source, such as a rechargeable battery (e.g., a lithium-ion or lithium-polymer (Li-poly) battery) and / or a power converter, including a DC / DC power converter, an AC / DC power converter, a power adapter (which may be external), etc.
[0025] Figure 2 A system 200 is shown that includes an electronic device 220 and an associated powered accessory 210 that can facilitate obtaining accurate time information once power is reconnected or otherwise restored. The electronic device 220 can broadly correspond to the above with respect to Figure 1 The device 100 discussed includes one or more of the systems listed therein or even additional subsystems not discussed above. The electronic device 220 may be a personal / portable electronic device such as a personal or portable computer, a tablet computer, a smart phone, a wearable device, etc. The elements of the electronic device 220 will be discussed in more detail below.
[0026] Electronic device 220 may receive power from powered accessory 210. Powered accessory 210 may be a battery pack with additional subsystems, as described in more detail below. In some embodiments, powered accessory 210 may be an even more complex device, potentially including the components described above with respect to FIG. Figure 1 and one or more subsystems described in electronic device 100. Thus, in some embodiments, powered accessory 210 can itself be a personal / portable electronic device, such as a companion computing device or accessory, etc. For the purposes of the following description, all such devices will be referred to as "powered accessories", regardless of whether such devices have a range of functionality from an external battery pack to a full-fledged companion device that may be as powerful or more powerful than electronic device 220.
[0027] In one embodiment, the powered accessory 210 may include a power source, such as a battery 211. Although the discussion herein relates to batteries, any suitable energy storage device may be used, including capacitor banks, supercapacitors, solar panels, or other energy storage solutions. The battery 211 may provide power to the electronic device 220 via a connection 217. The connection 217 may be, for example, an galvanic connection using a suitable electrical connector, spring pins, or other electrical terminals. In some embodiments, the connection 217 may be a magnetic connection or an electromagnetic connection, such as a wireless power transmission link using inductive power transfer, capacitive power transfer, or the like, to transfer power from the powered accessory 210 (and specifically the battery 211) to the electronic device 220. The battery 211 may also provide information to a battery monitoring system 212, which may perform one or more battery monitoring and management functions, such as charge state monitoring, charge control, thermal monitoring, and the like. The battery monitoring system 212 may be implemented using any suitable combination of analog, digital, or programmable circuits including a programmable controller, an application specific integrated circuit (ASIC), etc., and may have the required sensors and connections to the battery 211 to perform the required functions, and may optionally include a control output that can drive a battery charger (not shown) to control the battery charging operation.
[0028] In some embodiments, the battery monitoring system 212 may be in communication with and / or controlled by a processing system 213. The processing system 213 may include a processing element (e.g., similar to the processor 101 discussed above) and memory, storage, and other components as described above with respect to FIG. Figure 1 Other associated elements described. In some embodiments, the processing system can be implemented using a suitably programmed microcontroller. The number of subsystems of the processing system 213 and the power and / or complexity can be determined by the overall functionality of the powered accessory 210 as appropriate. For devices such as removable battery packs, the processing system 213 can be a relatively simple microcontroller with relatively simple programming. For more complex powered accessories, such as companion computing devices, the processing system 213 can be more powerful, include more subsystems, and can even be implemented as multiple processing systems interconnected to allow data and information to be exchanged between them.
[0029] The processing system 213 can be coupled to a communication system 214, which can allow communication with other devices, such as communication between the powered accessory 210 and the electronic device 220. The communication can be carried out via a communication link 218. In some embodiments, this can be a wired communication link, in which case one or more conductive connections or wires couple the communication system 214 to a corresponding communication system 224 (discussed in more detail below). In some applications, such communication terminals or wires can be integrated into a common electrical connector and / or cable together with wires associated with power transfer from the battery 211. In some applications, the communication terminals or wires can be the same terminals or wires used for power transfer, where the communication signal is superimposed on the power "signal". In other applications, the communication link 218 can be a wireless communication link, using any suitable wireless communication protocol, such as those discussed above or any other wireless communication protocol. The communication link 218 can be a bidirectional power link, thereby allowing bidirectional communication between the powered accessory 210 and the electronic device 220. In some embodiments, the communications link may also allow for direct connection to other devices (e.g., a network link) or indirect connection to other devices (e.g., via electronic device 220 and its associated networking subsystems, described in more detail below).
[0030] The powered accessory 210 can also include a real-time clock 215. The real-time clock 215 can be coupled to the processing system 213 so that the processing system 213 can receive time information from the real-time clock 215 and allow the processing system 213 to set the real-time clock 215 using time information received from an external source, which can be the electronic device 220 or other external device. In some cases, manual user input can also be used to provide time setting information, such manual user input provided by a suitable user input or I / O interface of the powered accessory 210 and / or the electronic device 220. Further details of using the real-time clock 215 to provide or receive time information are described in more detail below.
[0031] Returning now to the electronic device 220, such a device may include a power conditioning system 221 that may receive power from the powered accessory 210 via the connection 217 described above. In some applications, the electronic device 220 may include its own energy storage (not shown). In this case, the energy received from the powered accessory 210 may be used to charge the internal energy storage of the device 220. In other applications, the electronic device 220 may include little to no internal storage and rely on the powered accessory 210 to power its own operations. In either case, the power conditioning system 221 may provide any required power conversion, charging management, and power distribution (not shown) to the various subsystems of the electronic device 220 via the power connection.
[0032] The electronic device 220 may also include a communication system 224, which may generally correspond to the communication system 214 of the powered accessory 210. As described above, this may allow communication between the powered accessory 210 and the electronic device 220 via the communication link 218. Communications exchanged over this link may include time synchronization and recovery operations, as described in more detail below. To this end, the communication system 224 may communicate with the processing system 223 of the electronic device 220. The processing system 223 may include a processing element (e.g., similar to the processor 101 discussed above) as well as memory, storage, and other devices as described above with respect to the processor 101. Figure 1 Other associated elements described. In some embodiments, the processing system can be implemented using a suitably programmed microcontroller. The number of subsystems of the processing system 223 and the power and / or complexity can be determined by the overall functionality of the electronic device 220 as appropriate. In at least some embodiments, the processing system 223 can be a fairly powerful system, including multiple subsystems, and can even be implemented as multiple separate processing systems interconnected to allow data and information to be exchanged between them.
[0033] The processing system 223 may also be coupled to a network system 226. The network system 226 may allow the electronic device 220 to communicate with external devices, such as other computing devices (e.g., via a local area network or "LAN", remote servers (e.g., via a wide area network or "WAN", such as the Internet), etc. To this end, the network system 226 may include a wired network system (e.g., wired Ethernet) and / or a wireless network system (e.g., WiFi), or any other suitable network system or combination of network systems. An example of such communication with an external device may be communication with a remote time server (e.g., a time server that employs the Network Time Protocol (NTP)), as described in more detail below. The electronic device 220 may also use the network system connection 226 for various other external communication purposes.
[0034] The processing system 223 may also include an internal clock 225. In some applications, this internal clock 225 may be susceptible to losing power (and thus current time information) when the electronic device 220 is powered off (e.g., by removing the powered accessory 210). In other cases, the power outage of the electronic device 220 and the internal clock 225 may be due to a discharge or other unavailability of an internal or external power source. In any case, it may be desirable to restore accurate time as quickly as possible once power is restored (e.g., by reconnecting the powered accessory 210). Examples of such techniques are described in more detail below.
[0035] The above description of system 200 including powered accessory 210 and electronic device 220 is merely exemplary and is intended to describe various subsystems that may be used to implement the time recovery and time setting techniques described in more detail below. The powered accessory 210 and / or electronic device 220 may include more, fewer, or different elements and subsystems and still perform the various techniques described below. Therefore, the above description should be considered merely exemplary and should not be construed to include the omission of any of the above systems or subsystems, the addition of other systems or subsystems, or the reallocation of functionality between systems or subsystems in a manner that may be suitable for a given embodiment, application, or specific implementation.
[0036] Figure 3 A communication and computation sequence 300 is shown for obtaining accurate time information once power is reconnected or otherwise restored. The communication and computation sequence may include multiple devices, including a powered accessory 210 and an electronic device 220 as described above. The communication and computation sequence may also include additional devices, such as a Network Time Protocol (NTP) server 330, as discussed in more detail below. Figure 3, time advances from the top of the page to the bottom. The communication and computing sequence 300 can begin with a connection event 331, in which a powered-off electronic device 220 is connected to a powered accessory 210. This can trigger a "boot" of the electronic device 220. As part of this boot process, the electronic device 220 can estimate the true time of its internal clock based on internal information. For example, the clock can be started with a defined epoch (i.e., a default date and time), such as midnight UTC on January 1, 1970 (UNIX epoch time), midnight UTC on January 1, 1980 (IBM BIOS epoch time), or any other suitable date (such as July 1, 2021).
[0037] This default epoch may not be a suitable time estimate for any number of operations, such as date and time stamps of files, log entries, registries, databases, authentication, etc. Accordingly, the electronic device 220 may be configured to update its clock from the default epoch by reference to internally available data. For example, the electronic device 220 may be configured to check the date and time stamps associated with files stored in the device, resetting its internal clock using the latest such time stamp. This may have the effect of bringing the clock closer to the time when the electronic device 220 was last run. While this may be a better estimate than the default epoch, it still may not take into account the amount of time that the electronic device 220 has been out of service (i.e., turned off) and disconnected from a power source.
[0038] Thus, the electronic device 220 may be further programmed or configured to request a time update from the powered accessory 210 via a request attachment time message 333a. As described above, the powered accessory 210 may have an internal clock that may provide a more accurate current time to the electronic device 220. The format of the request attachment time message 333a may take a variety of forms. For example, the request attachment time message may be in a format that is the same or similar to a standardized network time protocol (NTP) packet. Such packets allow the exchange of time information, including the time at which a time request packet is sent by a sender and received by a receiver, and a return data packet containing the time at which the receiver sends a reply and the uncertainty associated with the time estimate (e.g., send time, uncertainty message 333b).
[0039] The details of the NTP protocol are known to those skilled in the art, so they are not repeated here. The basic idea is that the requester can look at the time when it sent its request (according to its own clock and contained in the original packet), the time when the recipient received the request (according to the recipient's clock and added to the response packet), the time when the requester received the response (according to the recipient's clock), and optionally additional uncertainty information associated with the accuracy of the corresponding clocks (which can be added to the packet by the recipient and / or otherwise available to the requester) to estimate the delay in the communication channel between the requester and the recipient, and obtain an accurate estimate of the current time based on the response received from the recipient. The requester can then update its internal clock accordingly. These operations generally correspond to the NTP protocol, but a complete implementation of the NTP protocol may include additional steps, details, etc., which are not repeated here. In addition, the exchange between the electronic device 220 and the powered accessory 210 does not need to strictly correspond to the NTP protocol. In addition, although the standard NTP packet format provides a convenient communication format for exchanging time information between the electronic device 220 and the accessory 210, other packet formats that provide the required time information exchange and channel delay derivation can also be envisioned.
[0040] In any case, once the powered accessory 210 and the electronic device 220 are connected, the electronic device 220 can obtain an internal time estimate and then request an updated time from the powered accessory 210 via message 333a. Thus, the powered accessory 210 can provide a time update to the electronic device 220 via message 333b. The electronic device 220 can then (block 334) update its internal clock using the time estimate and the information received from the powered accessory 210 via message 333b. For some purposes, this may be sufficient. However, in some applications, it may be desirable for the electronic device 220 to receive further time updates from an external source (e.g., an NTP server 330). To this end, the electronic device 220 can use its network interface 226 to request a time update from the NTP server 330, which can be an NTP server located on a local network to which the electronic device 220 is connected or on a wide area network (such as the Internet) to which the electronic device 220 is connected. This can include a request time message 335a sent from the device 220 to the NTP server 330 via the network interface. Then, the NTP server 330 can send the time information back to the electronic device 220 via the network via message 335b. Since the NTP server can implement the standard NTP protocol, the request time message 335a and the send time message 335b can be in the standard NTP packet format. Once the updated time information is received from the NTP server 330, the device 220 can update (box 336) its internal clock and any corresponding delay and uncertainty parameters.
[0041] In some applications, the time received by the electronic device 220 from the NTP server 330 may be more accurate or authoritative than the time previously received from the powered accessory 210. This may be due to the clock drift in the powered accessory 210 because the powered accessory 210 previously lost power or other reasons. In some cases, the powered accessory 210 may not have its own network interface or other facilities for receiving time updates from the NTP server or other sources. Due to any of these reasons, it may be desirable for the electronic device 220 to provide updated time to the powered accessory 210. This can be achieved by the electronic device 220 sending a send update time message 337 to the powered accessory 210. The send update time message 337 may, but need not be, in a format corresponding to the NTP protocol. It may be advantageous to send an update time message 337 including the current time and information that the powered accessory 210 can use to obtain propagation delays, time uncertainty, etc. These parameters can be used by the powered accessory 210 (box 338) to update its internal clock, thereby allowing it to provide more accurate time estimates in the future.
[0042] Figure 4 Flowchart 400 shows a technique that a powered accessory device 210 can use to provide time information to an electronic device 220 and / or update its own internal clock. The technique can be performed, for example, by processing system 213 operating in conjunction with other components of powered accessory 210. The technique can begin at block 441. In block 442, powered accessory 210 can detect, for example, Figure 3 The reception of the request attachment time message 333a discussed above determines whether a time request has been received from the electronic device 220. If so, then in block 443, the time, delay, and uncertainty information may be sent to the electronic device 220, corresponding to the above with respect to Figure 3 The discussed sending time, uncertainty message 333b, and the process may continue, for example, by returning to start block 441.
[0043] Otherwise, in block 444, the powered accessory 210 can, for example, detect the Figure 3 The reception of the send update time message 337 determines whether a new time has been received. If so, the powered accessory 210 can update its real-time clock with the current time and update its channel delay and / or time uncertainty estimate based on the received message, and the process can continue, for example, by returning to the start block 441.
[0044] In box 447, the powered accessory 210 can determine whether a reset has been detected. Such a reset may be due to the discharge of the internal energy storage device (e.g., a battery) of the powered accessory or other reasons. In any case, such a reset may cause the real-time clock of the powered accessory 210 to reset, for example, return to its initial setting / default epoch. In this case, the time provided by the powered accessory 210 may not be as accurate as the time recovered from the electronic device 220. Therefore, it may be desirable to provide an indication that the time provided in this case has a large uncertainty associated with it. Therefore, if a reset of the powered accessory 210 and / or its real-time clock is detected, then in box 448, the powered accessory 210 can update the uncertainty associated with the time of the real-time clock to a value corresponding to the maximum uncertainty. As described in more detail below, this can notify the electronic device 220 that the time received from the powered accessory 210 may be unreliable, and the electronic device 220 can decide how to proceed, as described in more detail below.
[0045] The above process is only one exemplary implementation of a process that may be performed continuously by the powered accessory 210. Other variations are possible. For example, the various determinations may be performed in a different order. In some applications, the various determinations may be performed simultaneously and / or periodically based on different check / update frequencies, etc. Unless otherwise expressly noted, any or all such variations may be used in conjunction with other teachings and embodiments described herein.
[0046] Figure 5 Flowchart 500 shows a technique that an electronic device 220 may use to obtain accurate time information once power is reconnected or otherwise restored. The process begins in block 551, for example, upon a restart of the personal electronic device 220. In block 552, the electronic device 220 may set its time to an initial epoch value, as described above with respect to Figure 3 In block 553, electronic device 220 can set its internal clock to an internal recovery time, such as from a file system timestamp, as described above with respect to block 332. In block 554, electronic device 220 can request and receive a time update from powered accessory 210. This can correspond to the above with respect to Figure 3The request accessory time message 333a and the send time, uncertainty message 333b discussed. In box 555, the electronic device 220 can determine whether the received time is valid, that is, whether it is reliable enough to be used as a suitable substitute for the recovered internal time obtained in box 553. This can include, for example, a comparison or analysis of one or more uncertainty values that are part of the time packet received from the powered accessory. If the received uncertainty value is greater than the existing uncertainty value corresponding to the current setting of the clock of the electronic device 220 and / or if the received uncertainty value exceeds a threshold or other stored comparison index in the electronic device 220, the time can be considered invalid. Alternatively, if none of these conditions are met, the received time can be considered valid.
[0047] If the received time is determined to be valid (in block 555), the electronic device 220 may update its internal clock with the received attachment time (block 556). This operation corresponds to the above with respect to Figure 3 The process may proceed to block 557, where an NTP time update may be requested from an NTP server via the network (as described above). This corresponds to the above with respect to Figure 3 Otherwise, if the time received from the powered accessory 210 is determined to be invalid, the process can proceed directly to block 557 without updating the internal clock of the electronic device 220. In either case, a period of time may be required between the above initial operations and the time update request of the network time server can be sent. For example, the electronic device 220 may not have an available network connection, or such a network connection may not have been properly set up and configured to allow communication due to the ongoing boot process of the device.
[0048] In any case, once a connection to the NTP server can be established and an appropriate response is received, the electronic device 220 can update its internal clock using the time received from the NTP server (block 558, corresponding to Figure 3 In addition, in block 559, the electronic device 220 can provide a time update to the powered accessory 210, which corresponds to the above with respect to Figure 3 Discussed sending updated time message 337. Additionally, while electronic device 220 remains operational with an available network connection, electronic device 220 can continue to periodically request NTP updates from an NTP server, update its internal clock, and send the updated time to the powered accessory.
[0049] The above process is merely one exemplary implementation of a process that can be continuously performed by electronic device 220. Other variations are possible, including variations in the precise ordering of events, etc. In some cases, electronic device 220 can continuously and / or periodically request time updates from powered accessory 210, and only provide time updates from an NTP source if the uncertainty associated with the real-time clock of powered accessory 210 exceeds a threshold, etc. Unless otherwise expressly noted, any or all such variations can be used in conjunction with other teachings and embodiments described herein.
[0050] Described above are exemplary embodiments of systems and methods for providing time recovery and synchronization of electronic devices once the availability of the main power supply to such electronic devices is regained after the main power supply to such electronic devices is removed or otherwise unavailable. Although many specific features and various embodiments have been described, it should be understood that the various features and embodiments may be combined into various arrangements in specific embodiments unless otherwise specified as mutually exclusive. Therefore, the various embodiments described above are provided by way of example only and should not be construed as limiting the scope of the present disclosure. Various modifications and changes may be made to the principles and embodiments herein without departing from the scope of the present disclosure and without departing from the scope of the claims.
Claims
1. A system comprising an electronic device and a powered accessory, wherein: The electronic device comprises: a power conditioning circuit that receives power from the power receiving accessory; a first communication system, the first communication system communicating with the powered accessory; internal clock; and a first processing system coupled to the first communication system and the internal clock, wherein once the electronic device is connected to the powered accessory, the first processing system sends a first time update request to the powered accessory and updates the internal clock based on the first time update received from the powered accessory; and The power receiving accessories include: an energy storage device that delivers power to the electronic device; a second communication system, the second communication system communicating with the electronic device; Real-time clock; and A second processing system is coupled to the second communication system and the real time clock, wherein the processing system sends the first time update to the electronic device upon connection of the electronic device to the powered accessory and receipt of the first time update request from the electronic device.
2. The system of claim 1, wherein the first time update request is in the form of a network time protocol packet.
3. The system of claim 2, wherein the first time update is in the form of the network time protocol packet.
4. The system of claim 1 , wherein the electronic device further comprises a network interface coupled to the first processing system, and the first processing system sends a second time update request to a network time protocol server via the network interface according to a network time protocol, and receives a second time update from the network time protocol server via the network interface according to the network time protocol.
5. The system of claim 4, wherein: the first processing system sending a third time update to the powered accessory via the first communication system; The third time update is based on the second time update received from the network time protocol server; and The second processing system updates the real time clock based on the third time update.
6. An electronic device, comprising: a power conditioning circuit that receives power from a powered accessory; a first communication system, the first communication system communicating with the powered accessory; Internal clock; and and a first processing system coupled to the first communication system and the internal clock, wherein once the electronic device is connected to the powered accessory, the first processing system sends a first time update request to the powered accessory and updates the internal clock based on the first time update received from the powered accessory.
7. The electronic device of claim 6, wherein the first time update request and the first time update are in the form of network time protocol packets. 8 . The electronic device of claim 7 , wherein the first time update request and the first time update do not correspond to a network time protocol.
9. The electronic device of claim 6, wherein the first time update includes information about a current time, a communication delay between the electronic device and the powered accessory, and a powered accessory clock uncertainty value.
10. The electronic device of claim 9, wherein the first processing system does not update the internal clock if the powered accessory clock uncertainty value exceeds a threshold.
11. The electronic device of claim 6, wherein the first processing system uses an internal recovery time to update the internal clock before sending the first time update request to the powered accessory.
12. The electronic device of claim 11, wherein the internal resume time is based on a file system timestamp associated with the first processing system.
13. The electronic device according to claim 6, further comprising a network interface coupled to the first processing system, and the first processing system performs the following operations: sending a second time update request to a network time protocol server via the network interface according to the network time protocol; receiving a second time update from the network time protocol server via the network interface according to the network time protocol; as well as The internal clock is updated based on the second time update.
14. The electronic device of claim 13, wherein the first processing system sends a third time update to the powered accessory via the first communication system, and the third time update is based on the second time update received from the network time protocol server.
15. A power receiving accessory for supplying power to an electronic device, the power receiving accessory comprising: an energy storage device that delivers power to the electronic device; a communication system, the communication system communicating with the electronic device; Real-time clock; and A processing system is coupled to the communication system and the real time clock, wherein the processing system sends a first time update to the electronic device upon the electronic device being connected to the powered accessory and a first time update request being received from the electronic device.
16. The powered accessory of claim 15, wherein the first time update request and the first time update are in the form of network time protocol packets.
17. The powered accessory of claim 16, wherein the first time update request and the first time update do not correspond to a network time protocol.
18. The powered accessory of claim 15, wherein the first time update includes information about a current time, a communication delay between the electronic device and the powered accessory, and a powered accessory real-time clock uncertainty value.
19. The power receiving accessory according to claim 15, wherein: The processing system receives a second time update from the electronic device via the communication system; and The processing system updates the real time clock based on the second time update.
20. The powered accessory of claim 15, wherein the processing system detects a reset that may affect the real time clock and, in response thereto, sets an uncertainty value associated with the real time clock to a maximum value.
