Time synchronization method, electronic device, chip and readable storage medium
By obtaining time difference information through the timer module in the earphone case, the problem of inaccurate body temperature measurement time when the earphones are not synchronized is solved, and the body temperature measurement time can still be accurately determined after power failure.
Patent Information
- Application Number
- CN202210182090.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-02-25
AI Technical Summary
The temperature measurement time recorded by the headphones before time synchronization is inaccurate, especially after entering transport mode, the measurement time cannot be determined.
The timer module in the earphone compartment obtains the time information of the earphone entering and leaving the earphone compartment, calculates and sends the time difference information to the earphone. The earphone uses this information and its own timer module count value to determine the historical measurement time.
Even after the headphones lose power, the body temperature measurement time can still be accurately determined, avoiding timing errors caused by transportation mode and ensuring the accuracy of body temperature measurement time.
Smart Images

Figure CN116744163B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a time synchronization method, electronic device, chip, and readable storage medium. Background Technology
[0002] With the technological development of smart terminal devices, the functions of various smart terminal devices are becoming increasingly rich. For example, wireless Bluetooth headphones (hereinafter referred to as headphones) can not only play audio, but also be used to measure body temperature.
[0003] When measuring body temperature via headphones, it's usually necessary to record the time of the measurement. However, due to cost considerations, headphones typically don't have a real-time clock (RTC) chip. Therefore, the headphones need to synchronize their time with an application installed on the phone to obtain the actual time information. In one possible scenario, the headphones might measure body temperature before time synchronization, resulting in inaccurate time recordings of the temperature measurement before synchronization.
[0004] Therefore, how to correct the historical moments recorded by the headphones before time synchronization has become an urgent problem to be solved. Summary of the Invention
[0005] This application provides a time synchronization method, electronic device, chip, and readable storage medium that can correct historical moments recorded by headphones before time synchronization.
[0006] Firstly, a time synchronization method is provided, applied to an earphone assembly including earphones and a charging case, wherein the earphones and charging case do not include a real-time clock (RTC) chip. The method includes: when the charging case detects that the earphone has entered the charging case, acquiring first time information, which indicates the moment the earphone entered the charging case; when the charging case detects that the earphone has left the charging case, acquiring second time information, which indicates the moment the earphone left the charging case; the charging case sending third time information to the earphone, which indicates the time difference between the earphone entering and leaving the charging case; and the earphone acquiring a historical measurement moment based on the third time information, the fourth time information, and the real-time information. The historical measurement moment refers to the measurement moment corresponding to the earphone's body temperature measurement operation; the fourth time information is the time information acquired in the earphone.
[0007] The time synchronization method provided in the embodiments of this application is applied to an earphone assembly, which includes earphones and an earphone case. The earphones and earphone case do not include a Real-Time Clock (RTC) chip. When the earphone case detects that the earphone has entered the earphone case, it acquires first time information. When the earphone case detects that the earphone has left the earphone case, it acquires second time information. The earphone case sends third time information to the earphones. The earphones acquire historical measurement times based on the third time information, the fourth time information, and the real-time information. The first time information indicates the time when the earphone enters the earphone case, the second time information indicates the time when the earphone leaves the earphone case, and the third time information indicates the time when the earphone enters the earphone case and the time when the earphone leaves the earphone case. The time difference in the charging case refers to the measurement time corresponding to the temperature measurement operation of the earphone. The fourth time information is the time information obtained from the earphone. That is to say, if the earphone loses power after being put into the charging case and the earphone cannot perform the timing function, the third time information obtained by the timing function of the charging case is used to continue the timing of the earphone. When the earphone is powered on again, the charging case sends the third time information to the earphone. This allows the earphone to use the third time information, the fourth time information obtained by the earphone itself, and the actual time information to determine the measurement time of each temperature measurement. This avoids the situation where the earphone loses power after entering the transport mode and the measurement time cannot be determined.
[0008] In one embodiment, the earphones enter the earphone case at least twice. The earphones obtain historical measurement times based on third time information, fourth time information, and actual time information, including: determining a first time period based on the third time information and fourth time information, where the first time period refers to the time difference between the first time the earphones leave the earphone case and the last time the earphones take body temperature measurements; determining a second time period based on the third time information and fourth time information, where the second time period refers to the time difference between the moment the earphones first leave the earphone case and the moment indicated by the actual time information; and obtaining the historical measurement times based on the difference between the first time period and the second time period, and the actual time information.
[0009] In the embodiments of this application, a first time period is first determined based on third and fourth time information, then a second time period is determined based on the third, fourth, and actual time information, and finally the historical measurement time is obtained based on the first and second time periods. The first time period refers to the time difference between the first time the earphone leaves the earphone case and the last time the earphone performs a body temperature measurement, and the second time period refers to the time difference between the moment the earphone first leaves the earphone case and the moment indicated by the actual time information. This allows the earphone to continue timing when it loses power after entering the earphone case and cannot perform the timing function. The third time information obtained from the earphone case's timing function is used to continue timing the earphone. When the earphone is powered back on, the earphone case sends the third time information to the earphone, enabling the earphone to determine the measurement time for each body temperature measurement using the third time information, the first time period, the second time period, and the actual time information. This avoids the situation where the earphone loses power after entering transport mode, making it impossible to determine the body temperature measurement time.
[0010] In one embodiment, determining the first time period based on the third time information and the fourth time information includes: determining the third time period and the fourth time period based on the fourth time information, wherein the third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone's body temperature is measured, and the fourth time period refers to the time difference between the earphone leaving the earphone case and the earphone entering the earphone case; and obtaining the first time period based on the sum of the third time period, the fourth time period, and the third time information.
[0011] In the embodiments of this application, the third time period and the fourth time period are determined based on the fourth time information, and the first time period is determined based on the sum of the third time period, the fourth time period, and the third time information. The third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone performs a body temperature measurement, and the fourth time period refers to the time difference between the earphone leaving the earphone case and the earphone entering the earphone case. The first time period is determined based on the third time period, the fourth time period, and the third time information. Then, the historical measurement time is determined based on the first time period and the second time period. This allows the earphone to continue timing when it loses power after entering the earphone case and cannot perform the timing function. When the earphone is powered back on, the earphone case sends the third time information to the earphone, enabling the earphone to determine the measurement time for each body temperature measurement using the third time information, the first time period, the second time period, and the actual time information. This avoids the situation where the earphone loses power after entering transport mode, making it impossible to determine the body temperature measurement time.
[0012] In one embodiment, the aforementioned fourth time information includes the count values of the timer in the earphone each time the earphone leaves the earphone case, each time the earphone enters the earphone case, and each time the earphone performs a body temperature measurement. Determining the third and fourth time periods based on the fourth time information includes: obtaining the third time period based on the difference between the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone last performed a body temperature measurement; and obtaining the fourth time period based on the difference between the count value of the timer in the earphone when the earphone leaves the earphone case and the count value of the timer in the earphone when the earphone enters the earphone case.
[0013] In the embodiments of this application, the fourth time information is obtained based on the count value of the timer module in the earphone. That is to say, the fourth time information is simply obtained based on the count value of the timer module in the earphone, which improves the convenience of obtaining the fourth time information.
[0014] In one embodiment, determining the second time period based on the third and fourth time information includes: obtaining the fifth time period based on the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone acquired the actual time information; and using the sum of the fourth time period, the fifth time period, and the third time information as the second time period.
[0015] In one embodiment, the first time information, the second time information, and the third time information are obtained based on the count value of the timer in the earphone compartment.
[0016] In the embodiments of this application, the first time information, the second time information, and the third time information are obtained based on the count value of the timer module in the earphone compartment. That is to say, the first time information, the second time information, and the third time information can be obtained by simply reading the count value of the timer module, which improves the convenience of obtaining the first time information, the second time information, and the third time information.
[0017] In one embodiment, after the earphone compartment sends third time information to the earphones, the method further includes: the earphones receiving actual time information sent by a terminal device, the terminal device including an actual time chip (RTC).
[0018] It should be understood that terminal devices can refer to electronic devices that include an RTC, such as mobile phones, tablets, etc.
[0019] In the embodiments of this application, the earphone receives the actual time information sent by the terminal device. That is to say, the actual time information obtained by the earphone is simply obtained by receiving the information sent by the terminal device, which improves the convenience of the earphone in obtaining the actual time information, and further improves the convenience of determining the historical measurement time based on the third time information, the fourth time information and the actual time information.
[0020] Secondly, a time synchronization method is provided, which is applied to the earphones in an earphone assembly. The earphone assembly includes earphones and an earphone case, but the earphones and earphone case do not include a real-time clock (RTC) chip. The method includes: receiving third time information sent by the earphone case when the earphone leaves the earphone case, the third time information indicating the time difference between the earphone entering the earphone case and the earphone leaving the earphone case; obtaining a historical measurement moment based on the third time information, a fourth time information, and actual time information; the historical measurement moment refers to the actual moment corresponding to the earphone's body temperature measurement operation; the fourth time information is the time information obtained by the earphone.
[0021] In one embodiment, obtaining the historical measurement time based on the third time information, the fourth time information, and the actual time information includes: determining a first time period based on the third time information and the fourth time information, wherein the first time period refers to the time difference between the first time the earphone leaves the earphone case and the last time the earphone takes a body temperature measurement; determining a second time period based on the third time information and the fourth time information, wherein the second time period refers to the time difference between the moment the earphone first leaves the earphone case and the moment indicated by the actual time information; and obtaining the historical measurement time based on the difference between the first time period and the second time period, and the actual time information.
[0022] In one embodiment, determining the first time period based on the third time information and the fourth time information includes: determining the third time period and the fourth time period based on the fourth time information, wherein the third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone's body temperature is measured, and the fourth time period refers to the time difference between the earphone leaving the earphone case and the earphone entering the earphone case; and obtaining the first time period based on the sum of the third time period, the fourth time period, and the third time information.
[0023] In one embodiment, the aforementioned fourth time information includes the count values of the timer in the earphone each time the earphone leaves the earphone case, each time the earphone enters the earphone case, and each time the earphone performs a body temperature measurement. Determining the third and fourth time periods based on the fourth time information includes: obtaining the third time period based on the difference between the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone last performed a body temperature measurement; and obtaining the fourth time period based on the difference between the count value of the timer in the earphone when the earphone leaves the earphone case and the count value of the timer in the earphone when the earphone enters the earphone case.
[0024] In one embodiment, determining the second time period based on the third and fourth time information includes: obtaining the fifth time period based on the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone acquired the actual time information; and using the sum of the fourth time period, the fifth time period, and the third time information as the second time period.
[0025] In one embodiment, after receiving the third time information sent from the earphone compartment to the earphone, the method further includes: receiving actual time information sent by a terminal device, wherein the terminal device includes an actual time chip (RTC).
[0026] The above time synchronization method is similar in principle and beneficial effect to the time synchronization method provided by the first method, and will not be repeated here.
[0027] Thirdly, a time synchronization method is provided, which is applied to an earphone compartment in an earphone assembly. The earphone assembly includes earphones and an earphone compartment, and the earphones and earphone compartment do not include a real-time clock (RTC) chip. The method includes: when the earphones are detected to have entered the earphone compartment, acquiring first time information, which indicates the time when the earphones enter the earphone compartment; when the earphones are detected to have left the earphone compartment, acquiring second time information, which indicates the time when the earphones leave the earphone compartment; and sending third time information to the earphones, which indicates the time difference between the time the earphones enter the earphone compartment and the time when the earphones leave the earphone compartment.
[0028] The above time synchronization method is similar in principle and beneficial effect to the time synchronization method provided by the first method, and will not be repeated here.
[0029] Fourthly, a time synchronization device is provided, including a unit for performing any of the methods in the second aspect. The device may be a terminal device or a chip within a terminal device. The device may include an input unit and a processing unit.
[0030] When the device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory for storing computer program code, which, when the processor executes the computer program code stored in the memory, causes the terminal device to perform any of the methods in the second aspect.
[0031] When the device is a chip within a terminal device, the processing unit can be an internal processing unit of the chip, and the input unit can be an output interface, pin, or circuit, etc.; the chip may also include a memory, which can be an internal memory of the chip (e.g., registers, cache, etc.) or an external memory (e.g., read-only memory, random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip performs any of the methods in the second aspect.
[0032] In one possible implementation, the memory stores computer program code; the processor executes the computer program code stored in the memory. When the computer program code stored in the memory is executed, the processor performs the following: when the headphones leave the headphone case, it receives third time information sent by the headphone case, the third time information indicating the time difference between the headphones entering and leaving the headphone case; it obtains the historical measurement time based on the third time information, the fourth time information, and the actual time information; the historical measurement time refers to the actual time corresponding to the headphone's body temperature measurement operation; the fourth time information is the time information obtained by the headphones.
[0033] Fifthly, a time synchronization device is provided, including a unit for performing any of the methods in the third aspect. The device may be a terminal device or a chip within a terminal device. The device may include an input unit and a processing unit.
[0034] When the device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory for storing computer program code, which, when the processor executes the computer program code stored in the memory, causes the terminal device to perform any of the methods in the third aspect.
[0035] When the device is a chip within a terminal device, the processing unit can be an internal processing unit of the chip, and the input unit can be an output interface, pin, or circuit, etc.; the chip may also include memory, which can be memory within the chip (e.g., registers, cache, etc.) or memory located outside the chip (e.g., read-only memory, random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, it causes the chip to execute any of the methods in the third aspect.
[0036] In one possible implementation, the memory is used to store computer program code; the processor executes the computer program code stored in the memory. When the computer program code stored in the memory is executed, the processor performs the following: when the earphone is detected to be entering the earphone case, acquiring first time information, the first time information indicating the moment the earphone enters the earphone case; when the earphone is detected to be leaving the earphone case, acquiring second time information, the second time information indicating the moment the earphone leaves the earphone case; and sending third time information to the earphone, the third time information indicating the time difference between the earphone entering and leaving the earphone case.
[0037] In a sixth aspect, an electronic device is provided, the electronic device including a processor, the processor being configured to couple with a memory, read instructions from the memory, and cause the electronic device to execute the method provided in the second aspect according to the instructions.
[0038] In a seventh aspect, an electronic device is provided, the electronic device including a processor, the processor being configured to couple with a memory, read instructions from the memory, and cause the electronic device to execute the method provided in the third aspect according to the instructions.
[0039] Eighthly, a computer-readable storage medium is provided, which stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the method provided in the second aspect.
[0040] In a ninth aspect, a computer-readable storage medium is provided, which stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the method provided in the third aspect.
[0041] In a tenth aspect, a chip is provided, the chip including a processor for coupling with a memory and executing a computer program in the memory to perform the method provided in the second aspect.
[0042] In the eleventh aspect, a chip is provided, the chip including a processor for coupling with a memory and executing a computer program in the memory to perform the method provided in the third aspect.
[0043] In a twelfth aspect, a computer program product containing instructions is provided, which, when run on an electronic device, causes the electronic device to perform the method provided in the second aspect.
[0044] In a thirteenth aspect, a computer program product containing instructions is provided, which, when run on an electronic device, causes the electronic device to perform the method provided in the third aspect. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of the existing technology for measuring body temperature via headphones;
[0046] Figure 2 This is a schematic diagram of an abnormal body temperature curve.
[0047] Figure 3 This is a schematic diagram of the existing technology for measuring body temperature via headphones;
[0048] Figure 4 This is a schematic diagram illustrating an application scenario of the time synchronization method in one embodiment of this application;
[0049] Figure 5 This is a software structure block diagram of an electronic device in one embodiment of this application;
[0050] Figure 6This is a flowchart illustrating a time synchronization method in one embodiment of this application;
[0051] Figure 7 This is a schematic diagram showing the relationship between different moments during body temperature measurement in one embodiment of this application;
[0052] Figure 8 This is a flowchart illustrating a time synchronization method in another embodiment of this application;
[0053] Figure 9 This is a schematic diagram showing the relationship between different moments during body temperature measurement in another embodiment of this application;
[0054] Figure 10 This is a schematic diagram showing the relationship between different moments during body temperature measurement in another embodiment of this application;
[0055] Figure 11 This is a flowchart illustrating a time synchronization method in another embodiment of this application;
[0056] Figure 12 This is a flowchart illustrating a time synchronization method in another embodiment of this application;
[0057] Figure 13 This is a schematic diagram of the time synchronization device in one embodiment of this application;
[0058] Figure 14 This is a schematic diagram of an electronic device in one embodiment of this application. Detailed Implementation
[0059] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0060] Hereinafter, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include one or more of that feature.
[0061] Currently, with the development of smart terminal technology, smart terminal devices are realizing more and more functions. For example, TWS earbuds can not only play audio content, but also measure human body temperature. During the body temperature measurement process, the measurement time is usually recorded, and a body temperature curve is generated based on the temperature measurement result and the corresponding measurement time. TWS earbuds usually do not have an RTC, so the earbuds themselves cannot determine the actual time. After a communication connection is established between the TWS earbuds and the mobile phone, an application installed on the mobile phone can be used to obtain the actual time information sent by the mobile phone, and a timer is started based on this actual time information to obtain the actual time. This process is called time synchronization.
[0062] In one possible scenario, the TWS earbuds did not synchronize their time with the phone before taking body temperature measurements, which could lead to an incorrect temperature detection time. For example, ... Figure 1 As shown, the TWS earbuds measured body temperature at time T0, but only synchronized with the phone at time T1. This means that between time T0 and time T1, the TWS earbuds did not synchronize with the phone, and the detected body temperature occurred at an incorrect time. Figure 2 As shown.
[0063] In one possible scenario, the TWS earbuds synchronize their time with the phone before taking body temperature measurements. However, if the TWS earbuds remain in the charging case for an extended period, such as more than 3 hours, they will enter transport mode to conserve battery power. When the TWS earbuds enter transport mode, the reference time synchronized from the phone will be lost. For example, as shown... Figure 3 As shown, at time T0, the TWS earbuds synchronize their time with the phone. At time T1, the TWS earbuds enter the charging case and leave at time T2. If the interval between time T2 and T1 is too long, the TWS earbuds enter transport mode between T1 and T2, causing them to lose their reference time. If the TWS earbuds do not synchronize their time with the phone after leaving the charging case and body temperature is measured directly, the recorded body temperature measurement time will be incorrect, resulting in errors such as... Figure 2 The curve shown.
[0064] To facilitate understanding, the relevant terms and concepts that may be involved in the embodiments of this application will be introduced below.
[0065] (1) Real-time Clock (RTC)
[0066] RTC stands for Integrated Circuit, commonly known as a clock chip. Real-time clock chips are among the most widely used consumer electronics products in daily life. They provide people with accurate real-time time or provide electronic systems with a precise time reference. Currently, most real-time clock chips use high-precision crystal oscillators as their clock source.
[0067] (2) True Wireless Stereo (TWS)
[0068] TWS technology refers to a technology where a mobile phone connects to a main speaker, which then wirelessly connects to a secondary speaker via Bluetooth, achieving true wireless separation of the left and right Bluetooth channels. When the secondary speaker is not connected, the main speaker reverts to mono sound quality. When TWS technology is applied to Bluetooth headphones, it results in TWS Bluetooth headphones. It should be noted that the headphones mentioned in this application embodiment may or may not be TWS headphones.
[0069] (3) Transportation Mode
[0070] Transportation mode typically refers to the lowest quiescent current state of an electronic device. When an electronic device is in transportation mode, it usually means that the battery connection has been disconnected to reduce battery power loss. At the same time, the timer in the electronic device may also stop working when the battery connection is disconnected, resulting in discontinuous counting by the timer and thus timer timing errors.
[0071] The time synchronization method provided in this application embodiment can be applied to an earphone assembly, which includes earphones and an earphone case, wherein the earphones typically refer to TWS earphones.
[0072] The application scenarios of the embodiments of this application will be briefly described below.
[0073] With the development of smart terminal technology, TWS earbuds can perform other functions besides playing audio content, such as body temperature measurement. For example,... Figure 4 As shown, the user inserts the TWS earbuds into their ears, and the earbuds use an integrated temperature sensor to measure the user's body temperature. The TWS earbuds record the detected temperature and the corresponding detection time, and send the detected temperature and the corresponding detection time to the mobile phone. The mobile phone generates a body temperature curve and displays it to the user.
[0074] It should be understood that the above are illustrative examples of application scenarios and do not limit the application scenarios of this application in any way.
[0075] The following is combined Figures 5 to 12 The time synchronization method provided in the embodiments of this application will be described in detail.
[0076] The time synchronization method provided in this application is applied to an earphone assembly consisting of earphones and an earphone charging case. The earphones typically refer to TWS earphones, which require the charging case for charging. The earphone charging case typically refers to the charging housing for the TWS earphones. Both the earphones and the charging case can utilize an embedded operating system to implement simple control functions, such as controlling the charging case to charge the earphones. In one example, the embedded operating system could be a LiteOS system.
[0077] Typically, a layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. The system software layered architecture diagram of TWS Bluetooth earphones can be shown as follows: Figure 5 As shown, it includes the application layer, framework layer, and kernel layer.
[0078] The application layer can include a series of application packages. For example, the application layer may include a box event module, a state management module, and an application interaction module.
[0079] The Box Events module is used to handle events detected by the box, such as the earphone entering or leaving the box.
[0080] The application interaction module is used to handle user-level interaction events as well as interaction events between the headset and other devices, such as mobile phones.
[0081] The framework layer includes modules such as device management, storage management, and application management.
[0082] The kernel layer is the layer between hardware and software. For example, the kernel layer includes timers and serial communication modules.
[0083] A timer is used to simulate a clock for timing.
[0084] The serial communication module is used for serial communication between the headphones and the headphone compartment. For example, the serial communication module can be used for event communication and time information transmission.
[0085] The timer in this application embodiment is typically a software timer, which is a timer simulated by software based on the system tick clock interrupt. Generally, the software timer uses a tick as the basic timing unit, and triggers a user-defined callback function after a set tick clock count value. The timing accuracy is related to the period of the system tick clock. The software timer is a system resource, and a contiguous block of memory is allocated during module initialization, using one system queue and one task resource. The timer typically counts once every tick clock cycle, ensuring a time difference between every two count values. For example, if the period of a tick clock is 10ms, then the first count value of the timer is 100000, and the second count value is 160000. The time difference between obtaining the first count value and obtaining the second count value is (160000-100000)*10ms = 600000ms, or 600 seconds. If the second count value is obtained at 10:30:00 on December 30, 2021, then the time corresponding to the first count value is 10:20:00 on December 30, 2021.
[0086] It should be noted that the software framework layer of any electronic device mentioned in the embodiments of this application may include, for example: Figure 5 The software framework shown may have more or fewer layers, and each layer may include, for example, Figure 5 The number of modules shown can be more or less.
[0087] The headphones may measure body temperature before synchronizing with the terminal device. In this case, such as Figure 6 As shown, at time T1, when the earphone leaves the charging case, it acquires the first count value of the Tick clock from the kernel layer's timer module. Then, at time T2, when body temperature measurement is performed, it acquires the second count value of the Tick clock from the timer module at the moment of body temperature measurement. At time T3, when the earphone is placed back into the charging case, it acquires the third count value of the Tick clock from the timer module. When the Hall sensor on the charging case detects that the earphone has been placed back into the case, the box event module in the application layer of the charging case initiates the earphone-in-box event, acquires the fourth count value of the Tick clock from the kernel layer's timer module at time T3, and sends the fourth count value to the application interaction module.
[0088] When the Hall sensor in the earphone case detects that the earphone has left the case at time T4, the application layer's box event module initiates an earphone removal event and obtains the fifth count value of the current tick clock in the earphone case's kernel layer. This fifth count value is then sent to the application interaction module. Further, the application interaction module in the earphone case obtains the difference between the fifth and fourth count values. This difference can be used as the third time information, or it can be the product of the difference between the fifth and fourth count values and the tick clock period. In other words, it represents the time difference between the earphone entering and leaving the earphone case. Then, the serial communication module in the earphone case sends this third time information to the earphone's serial communication module. Simultaneously, at time T4, when the earphone leaves the case, the earphone obtains the sixth count value from the earphone's timer module. At time T5, when the earphone performs another temperature measurement, the seventh count value from the earphone's timer module is obtained. It should be understood that the seventh count value is calculated based on the third time information. At time T6, when the earphone synchronizes with the terminal device, the eighth count value from the earphone's timer module is obtained. That is, the eighth count value is the count value corresponding to the actual time information synchronized to the earphone by the terminal device.
[0089] It should be understood that the fourth time information shown in the embodiments of this application may include the first count value, the second time value, the third count value, the sixth count value, the seventh count value, and the eighth count value.
[0090] The application interaction module in the earphone can obtain the measurement time corresponding to the earphone's body temperature measurement operation based on the third time information, the fourth time information, and the actual time information.
[0091] Let's take the example of the earphones leaving the charging case twice before synchronizing time with the terminal device as an example. Figure 7 As shown, based on the first count value and the third count value, we can obtain... Based on the fourth and fifth count values, we can obtain... Based on the sixth and eighth count values, we can obtain... Based on the sixth and seventh count values, we can obtain... Based on the second and third count values, we can obtain...
[0092] By synchronizing the headphones with the terminal device, the actual time of time T6 can be determined. Subtracting X from the actual time indicated by T6 yields the actual time corresponding to time T5, where the headphones perform body temperature measurement. and Obtain the actual time corresponding to time T2 when the body temperature is measured using headphones.
[0093] Among them, the third-time information obtained by the earphones from the charging case. Superimposed on the time difference between the earphones leaving the case 1 and the earphones being inserted into the case 1 Tick 2 is obtained. The earphone timer starts from earphone ejection point 2, and the time difference between earphone ejection point 2 and time synchronization is calculated. And As part of Tick 3, the earbuds begin timing from the moment they leave the case, incorporating third-party time information acquired from the charging case. Then superimpose the time from when the earphones are removed from the case 2 to when the body temperature is measured 2. The obtained duration is 2Tick1. Based on Tick2, Tick3, and 2Tick1, X can be obtained using the formula X = Tick2 + Tick3 - 2Tick1.
[0094] Since the headphones and terminal device synchronize their time at time T6, the actual time of body temperature measurement 2 can be obtained by subtracting X from the synchronized time information. Correspondingly, based on the actual time obtained at time T5, we can continue to subtract... and The actual time of body temperature measurement 1 is obtained.
[0095] In one example, the flowchart of the time synchronization method provided in this application embodiment can be as follows: Figure 8 As shown, this method is applied to an earphone assembly, which includes an earphone case and earphones. It should be understood that neither the earphone case nor the earphones typically contain a Real-Time Clock (RTC) chip. The method includes:
[0096] S101. When the earphone compartment detects that the earphone has entered the earphone compartment, it obtains the first time information, which is used to indicate the moment when the earphone entered the earphone compartment.
[0097] The first-time information can be used to indicate the moment the earphones are placed in the charging case. Optionally, when the Hall sensor on the charging case detects that the earphones have been placed in the charging case, the count value of the timer module in the charging case's core layer can be obtained as the first-time information. That is to say, the first-time information is obtained based on the count value of the timer module in the charging case.
[0098] S102. When the earphone compartment detects that the earphone has left the earphone compartment, it obtains the second time information, which is used to indicate the moment when the earphone leaves the earphone compartment.
[0099] The second time information can be used to indicate the moment the earphones leave the charging case. Optionally, when the Hall sensor on the charging case detects that the earphones have left the charging case, the count value of the timer module in the charging case's kernel layer can be obtained as the second time information. That is to say, the second time information is obtained based on the count value of the charging case's timer module.
[0100] S103, The earphone case sends third time information to the earphones. The third time information is used to indicate the time difference between the earphones entering the earphone case and the earphones leaving the earphone case.
[0101] After obtaining the first and second time information, a third time information, representing the time difference between when the earphones enter the charging case and when they leave, can be obtained based on these information. The first time information can be the count value of the timer module when the earphones enter the charging case, the second time information can be the count value of the timer module when the earphones leave the charging case, and the third time information can be the difference between the count value of the timer module when the earphones leave the charging case and the count value of the timer module when the earphones enter the charging case; alternatively, it can be the product of this difference and the cycle length of each tick of the timer module. This embodiment does not impose any limitations on this. In other words, the third time information can be obtained based on the count value of the timer module in the charging case.
[0102] In the embodiments of this application, the first time information, the second time information, and the third time information are obtained based on the count value of the timer module in the earphone compartment. That is to say, the first time information, the second time information, and the third time information can be obtained by simply reading the count value of the timer module, which improves the convenience of obtaining the first time information, the second time information, and the third time information.
[0103] After receiving the third-time information, the earphone case sends the third-time information to the earphones.
[0104] It should be understood that the third time information can be the time difference between each time the earphones enter the charging case and the time when the earphones leave the charging case. In other words, the third time information can be the time difference between multiple earphones entering the charging case and the time when the earphones leave the charging case.
[0105] For example, such as Figure 9 As shown, the third time information can refer to the time difference between the earphones being inserted into the case and the earphones being removed from the case.
[0106] For example, such as Figure 10 As shown, the third time information can indicate the time difference between the earphone being inserted into the case 1 and the earphone being removed from the case 2, and the time difference between the earphone being inserted into the case 2 and the earphone being removed from the case 3.
[0107] S104. The earphone obtains the historical measurement time based on the third time information, the fourth time information, and the actual time information; the historical measurement time refers to the measurement time corresponding to the earphone's body temperature measurement operation; the fourth time information is the time information obtained from the earphone.
[0108] The fourth time information can indicate the time information acquired by the headphones. Optionally, the fourth time information is obtained based on the count value of the timer module in the headphones. For example, the fourth time information can be as follows: Figure 7 The first, second, third, sixth, seventh, and eighth count values shown are the count values of the earphone's timer module at time T1 (earphone removal 1), time T2 (earphone temperature measurement 1), time T3 (earphone insertion), time T4 (earphone removal 2), time T5 (earphone temperature measurement 2), and time T6 (earphone synchronization with the terminal device), respectively. If the time interval between time T3 (earphone insertion) and time T4 (earphone removal 2) is too long, the earphone enters transport mode, and the timer module stops working as the earphone enters transport mode. Therefore, after the earphone acquires the third count value, the timer module's counting is discontinuous, causing the sixth count value acquired when the earphone leaves the charging case and resumes operation to not be a continuous count based on the third count value.
[0109] In the embodiments of this application, the fourth time information is obtained based on the count value of the timer module in the earphone. That is to say, the fourth time information is simply obtained based on the count value of the timer module in the earphone, which improves the convenience of obtaining the fourth time information.
[0110] Although the earbuds enter transport mode after being placed in the charging case, the charging case remains in working mode, with its timer module continuously counting. The charging case sends a third time information—the time difference between when the earbuds enter and when they leave the charging case—to the earbuds, allowing them to determine the time difference between the third and sixth count values.
[0111] The earphones synchronized with the terminal device, thus determining the actual time corresponding to the eighth count value. Based on the time difference between the eighth count value and the count values measured by the earphones (the second and seventh count values), the real-time time of the temperature measurement can be determined. Specifically, the time difference between the seventh and eighth count values can be determined using the difference between the seventh and eighth count values. The time difference between the second and eighth count values can be determined using the difference between the first and third count values, the third time information, and the difference between the sixth and eighth count values. In other words, after receiving the third time information, the earphones can determine the measurement time corresponding to the temperature measurement operation based on the third time information, the fourth time information, and the actual time information.
[0112] This application provides a time synchronization method applied to an earphone assembly. The earphone assembly includes earphones and an earphone case, which do not include a Real-Time Clock (RTC) chip. When the earphone case detects that the earphone has entered the earphone case, it acquires first time information. When the earphone case detects that the earphone has left the earphone case, it acquires second time information. The earphone case sends third time information to the earphone. The earphone obtains historical measurement times based on the third time information, the fourth time information, and the real-time clock. The first time information indicates the time the earphone enters the earphone case, the second time information indicates the time the earphone leaves the earphone case, and the third time information indicates the time the earphone enters and leaves the earphone case. The time difference in the earphone case refers to the measurement time corresponding to the earphone's body temperature measurement operation. The fourth time information is the time information obtained from the earphone. That is to say, if the earphone loses power after being placed in the earphone case and cannot perform the timing function, the third time information obtained from the earphone case's timing function is used to continue the timing of the earphone. When the earphone is powered on again, the earphone case sends the third time information to the earphone. This allows the earphone to use the third time information, the fourth time information obtained by the earphone itself, and the actual time information to determine the measurement time of each body temperature measurement. This avoids the situation where the body temperature measurement time cannot be determined due to power loss after the earphone enters the transport mode.
[0113] In one possible scenario, if the earphones are inserted into the charging case at least twice before time synchronization with the terminal device, then it can be passed... Figure 11 To correct the measurement time before time synchronization, such as Figure 11 As shown, the method includes:
[0114] S201. When the earphone compartment detects that the earphone has entered the earphone compartment, it obtains the first time information, which is used to indicate the moment when the earphone entered the earphone compartment.
[0115] S202. When the earphone compartment detects that the earphone has left the earphone compartment, it obtains second time information, which is used to indicate the moment when the earphone leaves the earphone compartment.
[0116] S203, The earphone case sends third time information to the earphones. The third time information is used to indicate the time difference between the earphones entering the earphone case and the earphones leaving the earphone case.
[0117] Optionally, S204, the headset receives the actual time information sent by the terminal device.
[0118] Terminal devices can refer to electronic devices that include an RTC (Real-Time Control), such as mobile phones and tablets. The terminal device can obtain real-time information indicating the actual moment through the RTC and send this information to the headset when a communication connection is established.
[0119] In the embodiments of this application, the earphone receives the actual time information sent by the terminal device. That is to say, the actual time information obtained by the earphone is simply obtained by receiving the information sent by the terminal device, which improves the convenience of the earphone in obtaining the actual time information, and further improves the convenience of determining the historical measurement time based on the third time information, the fourth time information and the actual time information.
[0120] S205. Determine the first time period based on the third and fourth time information. The first time period refers to the time difference between the first time the earphone leaves the earphone case and the last time the earphone's body temperature is measured.
[0121] The first time period refers to the time difference between the first time the earphone leaves the earphone case and the last time the earphone is used for body temperature measurement. For example, such as... Figure 9 As shown, the first time period can refer to the time difference between the earphones being removed from the case (1) and the body temperature measurement (2). For example... Figure 10 As shown, the first time period can refer to the time difference between when the earphones are removed from the case (1) and when the body temperature is measured (3).
[0122] Optionally, S205 "determining the first time period based on the third and fourth time information" can be achieved through... Figure 12 The steps shown are to be implemented as follows:
[0123] S205A. Based on the fourth time information, determine the third time period and the fourth time period. The third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone's body temperature is measured. The fourth time period refers to the time difference between the earphone leaving the earphone case and the earphone entering the earphone case.
[0124] The fourth time information refers to the time information acquired by the headphones; that is, the time information acquired when the headphones are not losing power.
[0125] The third time period refers to the time difference between the last time the earphones left the charging case and the last time the earphones underwent a body temperature measurement. For example, such as... Figure 9 As shown, the third time period refers to the time difference between the earphones being removed from the case (2) and the body temperature measurement (2). For example... Figure 10 As shown, the third time period refers to the time difference between the earphone being removed from the case 3 and the body temperature measurement 3.
[0126] For example, the earphone can obtain the difference between the timer count values at the time when the earphone is removed from the case (3) and the timer count value at the time when the body temperature is measured (3). Then, multiply the difference by the period of a Tick clock (10ms) to obtain the third time period.
[0127] The fourth time period refers to the time difference between the earphones leaving the charging case and the earphones entering the charging case. It should be understood that "earphones entering the charging case" in the fourth time period refers to the next time the earphones enter the charging case after they have left it. For example, such as... Figure 9 As shown, the fourth time period refers to the time difference between the earphones leaving the case 1 and the earphones being placed back in the case. For example... Figure 10 As shown, the fourth time period refers to the time difference between the earphone leaving the case 1 and the earphone entering the case 1, and the time difference between the earphone leaving the case 2 and the earphone entering the case 2.
[0128] For example, the timer can be calculated by reading the timer counts when the headphones are removed from the case (step 1) and when they are inserted (step 1), obtaining the difference between these two timer counts, and then multiplying this difference by a 10ms tick clock cycle to obtain the time difference between the two time periods. Similarly, the timer counts when the headphones are removed from the case (step 2) and when they are inserted (step 2) can be read, and this difference can be multiplied by a 10ms tick clock cycle to obtain the time difference between the two time periods. This gives the fourth time period.
[0129] S205B: The first time period is obtained by summing the information from the third time period, the fourth time period, and the third time period.
[0130] As described above, the first time period indicates the time difference between the first time the earphone leaves the earphone case and the last time the earphone takes a body temperature measurement.
[0131] For example, such as Figure 9 As shown, the first time period can refer to the time difference between the earphones leaving the case 1 and the body temperature measurement 2. The third time period refers to the time difference between the earphones leaving the case 2 and the body temperature measurement 2. The fourth time period refers to the time difference between the earphones leaving the case 1 and the earphones being inserted into the case. The third time information refers to the time difference between the earphones being inserted into the case and the earphones leaving the case 2. By adding the third time period, the fourth time period, and the third time information together, the first time period can be obtained.
[0132] For example, such asFigure 10 As shown, the first time period can refer to the time difference between the earphones leaving the case 1 and the body temperature measurement 3. The third time period refers to the time difference between the earphones leaving the case 3 and the body temperature measurement 3. The fourth time period refers to the time difference between the earphones leaving the case 1 and the earphones being inserted into the case 1, and the time difference between the earphones leaving the case 2 and the earphones being inserted into the case 2. The third time information refers to the time difference between the earphones being inserted into the case 1 and the earphones leaving the case 2, and the time difference between the earphones being inserted into the case 2 and the earphones leaving the case 3. Adding the third time period, the fourth time period, and the third time information together yields the first time period.
[0133] In the embodiments of this application, the third time period and the fourth time period are determined based on the fourth time information, and the first time period is determined based on the sum of the third time period, the fourth time period, and the third time information. The third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone performs a body temperature measurement, and the fourth time period refers to the time difference between the earphone leaving the earphone case and the earphone entering the earphone case. The first time period is determined based on the third time period, the fourth time period, and the third time information. Then, the historical measurement time is determined based on the first time period and the second time period. This allows the earphone to continue timing when it loses power after entering the earphone case and cannot perform the timing function. When the earphone is powered back on, the earphone case sends the third time information to the earphone, enabling the earphone to determine the measurement time for each body temperature measurement using the third time information, the first time period, the second time period, and the actual time information. This avoids the situation where the earphone loses power after entering transport mode, making it impossible to determine the body temperature measurement time.
[0134] S206. Determine the second time period based on the third and fourth time information. The second time period refers to the time difference between the moment when the earphone first leaves the earphone case and the moment indicated by the actual time information.
[0135] The second time period refers to the time difference between the moment the earphones first leave the charging case and the moment indicated by the actual time information. For example, such as... Figure 9 As shown, the second time period can refer to the time difference between the earphones leaving the case 1 and time synchronization. For example, as... Figure 10 As shown, the second time period can refer to the time difference between when the earphone leaves the case and when the time synchronization time is reached.
[0136] Optionally, the fifth time period is obtained based on the count value of the timer in the earphone when it last leaves the earphone case and the count value of the timer in the earphone when it obtains the actual time information; and the sum of the fourth time period, the fifth time period and the third time information is used as the second time period.
[0137] S207. Based on the difference between the first and second time periods and the actual time information, the historical measurement time is obtained.
[0138] It should be understood that the difference between the first and second time periods is the difference between the actual time indicated by the real-time information and the time of the last temperature measurement. After obtaining the first and second time periods, the difference between the first and second time periods can be subtracted from the real-time time indicated by the real-time information to obtain the time of the last temperature measurement. Furthermore, the time difference between different temperature measurement counts and the last temperature measurement can be obtained from the differences between the count values of different temperature measurements, thus obtaining the time of each temperature measurement, which is the historical measurement time.
[0139] For example, such as Figure 9 As shown, the real-time time information indicates the time, which is also the time of time synchronization. Based on the time difference between the time synchronization time and temperature measurement 2 (i.e., the difference between the first and second time periods), the time of temperature measurement 2 is obtained. Furthermore, based on the third and fourth time information, the time difference between temperature measurement 1 and temperature measurement 2 can be obtained. Therefore, based on the time of temperature measurement 2 and the time difference between temperature measurement 1 and temperature measurement 2, the time of temperature measurement 1 can be obtained. In other words, based on the first and second time periods, the times of temperature measurement 1 and temperature measurement 2 can be obtained, which are the historical measurement times.
[0140] In the embodiments of this application, a first time period is first determined based on third and fourth time information, then a second time period is determined based on the third, fourth, and actual time information, and finally the historical measurement time is obtained based on the first and second time periods. The first time period refers to the time difference between the first time the earphone leaves the earphone case and the last time the earphone performs a body temperature measurement, and the second time period refers to the time difference between the moment the earphone first leaves the earphone case and the moment indicated by the actual time information. This allows the earphone to continue timing when it loses power after entering the earphone case and cannot perform the timing function. The third time information obtained from the earphone case's timing function is used to continue timing the earphone. When the earphone is powered back on, the earphone case sends the third time information to the earphone, enabling the earphone to determine the measurement time for each body temperature measurement using the third time information, the first time period, the second time period, and the actual time information. This avoids the situation where the earphone loses power after entering transport mode, making it impossible to determine the body temperature measurement time.
[0141] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0142] Figure 13 This is a schematic diagram of a time synchronization device provided in an embodiment of this application.
[0143] It should be understood that the time synchronization device 600 can perform... Figures 5 to 12 The time synchronization method shown; the time synchronization device 600 is applied to the earphone in the earphone assembly, the earphone assembly includes the earphone and the earphone case, the earphone and the earphone case do not include the actual time chip RTC, the time synchronization device 600 includes: acquisition unit 610 and processing unit 620.
[0144] In one example, the acquisition unit 610 is used to receive third time information sent by the earphone case when the earphone leaves the earphone case. The third time information indicates the time difference between the earphone entering the earphone case and the earphone leaving the earphone case.
[0145] The processing unit 620 is used to obtain the historical measurement time based on the third time information, the fourth time information and the actual time information; the historical measurement time refers to the actual time corresponding to the headphone's operation of measuring body temperature; the fourth time information is the time information obtained by the headphone.
[0146] In one example, the processing unit 620 is specifically used to determine a first time period based on the third time information and the fourth time information, the first time period being the time difference between the first time the earphone leaves the earphone case and the last time the earphone takes a body temperature measurement; to determine a second time period based on the third time information and the fourth time information, the second time period being the time difference between the moment the earphone first leaves the earphone case and the moment indicated by the actual time information; and to obtain the historical measurement moment based on the difference between the first time period and the second time period, and the actual time information.
[0147] In one example, the processing unit 620 is specifically used to determine the third time period and the fourth time period based on the fourth time information. The third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone takes a body temperature measurement. The fourth time period refers to the time difference between the earphone leaving the earphone case and the earphone entering the earphone case. The first time period is obtained based on the sum of the third time period, the fourth time period, and the third time information.
[0148] In one example, the fourth time information includes the count values of the timer in the earphone each time the earphone leaves the charging case, each time the earphone enters the charging case, and each time the earphone performs a body temperature measurement. In one example, the processing unit 620 is specifically used to obtain the third time period based on the difference between the count value of the timer in the earphone when the earphone last leaves the charging case and the count value of the timer in the earphone when the earphone last performs a body temperature measurement; and to obtain the fourth time period based on the difference between the count value of the timer in the earphone when the earphone leaves the charging case and the count value of the timer in the earphone when the earphone enters the charging case.
[0149] In one example, the processing unit 620 is specifically used to obtain the fifth time period based on the count value of the timer in the earphone when the earphone last leaves the earphone case and the count value of the timer in the earphone when the earphone obtains the actual time information; and to use the sum of the fourth time period, the fifth time period and the third time information as the second time period.
[0150] In one example, the processing unit 620 is also used to receive real time information sent by a terminal device, which includes a real time chip (RTC).
[0151] The time synchronization device provided in this embodiment is used to execute the time synchronization method of the above embodiment. The technical principle and technical effect are similar, and will not be described again here.
[0152] It should be noted that the aforementioned time synchronization device 600 is embodied in the form of a functional unit. The term "unit" here can be implemented in software and / or hardware, without specific limitations.
[0153] It should be understood that the time synchronization device 600 is applied to the earphone compartment in the earphone assembly, which includes earphones and earphone compartment. The earphones and earphone compartment do not include the actual time chip (RTC). The time synchronization device 600 includes an acquisition unit 610 and a processing unit 620.
[0154] The acquisition unit 610 is used to acquire first time information when it detects that the earphone has entered the earphone case, the first time information being used to indicate the time when the earphone has entered the earphone case; and to acquire second time information when it detects that the earphone has left the earphone case, the second time information being used to indicate the time when the earphone has left the earphone case.
[0155] The processing unit 620 is used to send third time information to the earphones, which indicates the time difference between the earphones entering the earphone case and the earphones leaving the earphone case.
[0156] The time synchronization device provided in this embodiment is used to execute the time synchronization method of the above embodiment. The technical principle and technical effect are similar, and will not be described again here.
[0157] It should be noted that the aforementioned time synchronization device 600 is embodied in the form of a functional unit. The term "unit" here can be implemented in software and / or hardware, without specific limitations.
[0158] For example, a "unit" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components that support the described functions.
[0159] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0160] Figure 14 A schematic diagram of the structure of an electronic device provided in this application is shown. Figure 14 The dashed lines indicate that the unit or module is optional. The electronic device 700 can be used to implement the time synchronization method described in the above method embodiments.
[0161] Electronic device 700 includes one or more processors 701, which support the implementation of the time synchronization method in the method embodiments of electronic device 700. Processor 701 can be a general-purpose processor or a special-purpose processor. For example, processor 701 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.
[0162] The processor 701 can be used to control the electronic device 700, execute software programs, and process data from the software programs. The electronic device 700 may also include a communication unit 705 for inputting (receiving) and outputting (transmitting) signals.
[0163] For example, electronic device 700 may be a chip, communication unit 705 may be the input and / or output circuit of the chip, or communication unit 705 may be the communication interface of the chip, and the chip may be a component of terminal device or other electronic device.
[0164] For example, electronic device 700 can be a terminal device, communication unit 705 can be the transceiver of the terminal device, or communication unit 705 can be the transceiver circuit of the terminal device.
[0165] The electronic device 700 may include one or more memories 702, which store a program 704. The program 704 can be executed by the processor 701 to generate instructions 703, causing the processor 701 to execute the time synchronization method described in the above method embodiments according to the instructions 703.
[0166] Optionally, the memory 702 may also store data. Optionally, the processor 701 may also read the data stored in the memory 702, which may be stored at the same memory address as the program 704, or the data may be stored at a different memory address than the program 704.
[0167] The processor 701 and memory 702 can be configured separately or integrated together; for example, integrated on the system on chip (SOC) of the terminal device.
[0168] For example, the memory 702 can be used to store the relevant program 704 of the time synchronization method provided in the embodiments of this application, and the processor 701 can be used to call the relevant program 704 of the time synchronization method stored in the memory 702 when performing time synchronization on the terminal device, and execute the time synchronization method of the embodiments of this application; including: when the earphone leaves the earphone case, receiving third time information sent by the earphone case, the third time information indicating the time difference between the earphone entering the earphone case and the earphone leaving the earphone case; obtaining the historical measurement time according to the third time information, the fourth time information and the actual time information; the historical measurement time refers to the actual time corresponding to the earphone's body temperature measurement operation; the fourth time information is the time information obtained by the earphone.
[0169] For example, the memory 702 can be used to store the relevant program 704 of the time synchronization method provided in the embodiments of this application, and the processor 701 can be used to call the relevant program 704 of the time synchronization method stored in the memory 702 when performing time synchronization on the terminal device, and execute the time synchronization method of the embodiments of this application; including: when it is detected that the earphone has entered the earphone case, obtaining first time information, the first time information being used to indicate the time when the earphone enters the earphone case; when it is detected that the earphone has left the earphone case, obtaining second time information, the second time information being used to indicate the time when the earphone leaves the earphone case; and sending third time information to the earphone, the third time information being used to indicate the time difference between the earphone entering the earphone case and the earphone leaving the earphone case.
[0170] This application also provides a computer program product that, when executed by processor 701, implements the time synchronization method described in any of the method embodiments of this application.
[0171] The computer program product can be stored in memory 702, for example, program 704. Program 704 is finally converted into an executable object file that can be executed by processor 701 after processing such as preprocessing, compilation, assembly and linking.
[0172] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the time synchronization method described in any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.
[0173] The computer-readable storage medium is, for example, memory 702. Memory 702 can be volatile memory or non-volatile memory, or memory 702 can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0174] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0175] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0176] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0177] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0178] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0179] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0180] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0181] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A time synchronization method, characterized in that, The method is applied to an earphone assembly, the earphone assembly including earphones and earphone case, wherein the earphones and earphone case do not include a real-time clock (RTC) chip, and the method includes: When the earphone compartment detects that the earphone has entered the earphone compartment, it acquires first time information, which is used to indicate the time when the earphone entered the earphone compartment. When the earphone case detects that the earphone has left the earphone case, it acquires second time information, which is used to indicate the time when the earphone left the earphone case; The earphone compartment sends third time information to the earphone, which is used to indicate the time difference between the first to Nth times the earphone enters the earphone compartment and the time after the earphone enters the earphone compartment for the next time it leaves the earphone compartment, where N is a positive integer greater than 0; The earphone receives real-time information sent by the terminal device, the terminal device including a real-time chip (RTC), and the real-time information is the moment when the terminal device establishes a communication connection with the earphone. The earphone obtains historical measurement times based on the third time information, the fourth time information, and the actual time information; the historical measurement times refer to the measurement times corresponding to the earphone's body temperature measurement operation; the fourth time information includes the count value of the timer in the earphone when the earphone leaves the earphone case, when it enters the earphone case, and when body temperature is measured, and the count value of the timer in the earphone when the terminal device synchronizes the actual time information to the earphone.
2. The method according to claim 1, characterized in that, The earphones enter the earphone compartment at least twice, and the earphones obtain historical measurement times based on the third time information, the fourth time information, and the actual time information, including: The first time period is determined based on the third time information and the fourth time information. The first time period refers to the time difference between the first time the earphone leaves the earphone case and the last time the earphone is used for body temperature measurement. The second time period is determined based on the third time information and the fourth time information. The second time period refers to the time difference between the moment when the earphone first leaves the earphone compartment and the moment indicated by the actual time information. The historical measurement time is obtained based on the difference between the first time period and the second time period, and the actual time information.
3. The method according to claim 2, characterized in that, Determining the first time period based on the third time information and the fourth time information includes: The third time period and the fourth time period are determined based on the fourth time information. The third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone is used for body temperature measurement. The fourth time period refers to the time difference between the first to M times the earphone leaves the earphone case and the next time the earphone enters the earphone case after the current time it leaves the earphone case. M is a positive integer greater than 0. The first time period is obtained by summing the third time period, the fourth time period, and the third time information.
4. The method according to claim 3, characterized in that, The step of determining the third time period and the fourth time period based on the fourth time information includes: The third time period is obtained by the difference between the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone last performed a body temperature measurement. The fourth time period is obtained based on the count value of the timer in the earphone when the earphone leaves the earphone case for the first to M times, and the difference between the count value of the timer in the earphone when the earphone enters the earphone case again after the current time it leaves the earphone case.
5. The method according to claim 4, characterized in that, Determining the second time period based on the third time information and the fourth time information includes: The fifth time period is obtained based on the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone obtains the actual time information; The sum of the fourth time period, the fifth time period, and the third time information is taken as the second time period.
6. The method according to any one of claims 1-5, characterized in that, The first time information, the second time information, and the third time information are obtained based on the count value of the timer in the earphone compartment.
7. A time synchronization method, characterized in that, The method is applied to earphones in an earphone assembly, the earphone assembly including the earphones and earphone housing, wherein the earphones and earphone housing do not include a real-time clock (RTC) chip, and the method includes: When the earphone leaves the earphone case, the third time information sent by the earphone case is received. The third time information indicates the time difference between the first to Nth times the earphone enters the earphone case and the next time the earphone leaves the earphone case after the current time it enters the earphone case, where N is a positive integer greater than 0. The device receives real-time information sent by a terminal device, wherein the terminal device includes a real-time chip (RTC), and the real-time information is the moment when the terminal device establishes a communication connection with the earphone. Historical measurement times are obtained based on the third time information, the fourth time information, and the actual time information; the historical measurement time refers to the actual time corresponding to the body temperature measurement operation of the earphone; the fourth time information includes the count value of the timer in the earphone when the earphone leaves the earphone case, when it enters the earphone case, and when body temperature is measured, and the count value of the timer in the earphone when the terminal device synchronizes the actual time information to the earphone.
8. The method according to claim 7, characterized in that, Historical measurement times are obtained based on the third time information, the fourth time information, and the actual time information, including: The first time period is determined based on the third time information and the fourth time information. The first time period refers to the time difference between the first time the earphone leaves the earphone case and the last time the earphone is used for body temperature measurement. The second time period is determined based on the third time information and the fourth time information. The second time period refers to the time difference between the moment when the earphone first leaves the earphone compartment and the moment indicated by the actual time information. The historical measurement time is obtained based on the difference between the first time period and the second time period, and the actual time information.
9. The method according to claim 8, characterized in that, Determining the first time period based on the third time information and the fourth time information includes: The third time period and the fourth time period are determined based on the fourth time information. The third time period refers to the time difference between the last time the earphone leaves the earphone case and the last time the earphone is used for body temperature measurement. The fourth time period refers to the time difference between the first to M times the earphone leaves the earphone case and the next time the earphone enters the earphone case after the current time it leaves the earphone case. M is a positive integer greater than 0. The first time period is obtained by summing the third time period, the fourth time period, and the third time information.
10. The method according to claim 9, characterized in that, The step of determining the third time period and the fourth time period based on the fourth time information includes: The third time period is obtained by the difference between the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone last performed a body temperature measurement. The fourth time period is obtained based on the count value of the timer in the earphone when the earphone leaves the earphone case for the first to M times, and the difference between the count value of the timer in the earphone when the earphone enters the earphone case again after the current time it leaves the earphone case.
11. The method according to claim 10, characterized in that, Determining the second time period based on the third time information and the fourth time information includes: The fifth time period is obtained based on the count value of the timer in the earphone when the earphone last left the earphone case and the count value of the timer in the earphone when the earphone obtains the actual time information; The sum of the fourth time period, the fifth time period, and the third time information is taken as the second time period.
12. A time synchronization device, characterized in that, The time synchronization device includes a processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program from the memory, causing the time synchronization device to perform the method according to any one of claims 7 to 11.
13. An electronic device, characterized in that, The electronic device includes a processor configured to be coupled to a memory, and to read instructions from the memory and, according to the instructions, cause the electronic device to perform the method as described in any one of claims 7 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 7 to 11.
15. A chip, characterized in that, The chip includes a processor for coupling with a memory and executing a computer program in the memory to perform the method as described in any one of claims 7 to 11.
Citation Information
Patent Citations
Earphone wearing state detection method and device, and earphone
CN112911438A
Body temperature measuring method and system using earphone
US20190142279A1
