Calibration method, log generation method and device, equipment, storage medium and product
By detecting calibration events in electronic devices and determining whether functional modules meet preset conditions before calibration, the problem of inconsistent time between functional modules and system time is solved, invalid calibrations are reduced, device power consumption is lowered, and the accuracy of abnormal data location is improved.
Patent Information
- Application Number
- CN202411170641.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2026-03-03
AI Technical Summary
The inconsistency between the operating time of functional modules in electronic devices and the system time makes it difficult for technicians to accurately locate abnormal problems, increasing the processing burden and power consumption.
By detecting calibration events and obtaining multiple calibration times, it is determined whether the functional module meets the preset calibration conditions. The indicated time is calibrated only when the conditions are met, reducing invalid calibrations and ensuring that the system time is synchronized with the functional module time.
It effectively reduces the processing burden on electronic devices, lowers power consumption, and improves the accuracy and efficiency of abnormal data location.
Smart Images

Figure CN121596957A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing, and more particularly to a calibration method, a log generation method, an apparatus, a device, a storage medium, and a product. Background Technology
[0002] Electronic devices often contain multiple functional modules, such as sensor hubs. Sensor hubs manage various sensors within the device, including accelerometers, gyroscopes, and magnetometers, reducing the power consumption and load on the application processor (AP). Sensor hubs typically include a low-power processor to process sensor data and, when necessary, pass the processed data to the application processor.
[0003] By analyzing the operational data of functional modules, technicians can promptly locate abnormal issues and prevent the fault from escalating. However, since the operational data of functional modules includes their running time, discrepancies between the module's running time and the electronic device's system time hinder technicians from pinpointing and analyzing anomalies. Summary of the Invention
[0004] To overcome the problems in related technologies, this disclosure provides a calibration method, log generation method, apparatus, device, storage medium, and product, which avoids invalid calibration, helps to reduce the processing burden of electronic devices, and reduces the power consumption of electronic devices.
[0005] According to a first aspect of the present disclosure, a time calibration method is provided, comprising:
[0006] In response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first moment, and a second moment in response to the first calibration event is determined;
[0007] Obtain the third moment to which the electronic device has been calibrated based on the second calibration event; wherein the second calibration event is the calibration event preceding the first calibration event;
[0008] Based on the first time point, the second time point, and the third time point, determine whether the functional modules in the electronic device meet the preset calibration conditions;
[0009] In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time.
[0010] In some embodiments, determining whether a functional module within the electronic device meets preset calibration conditions based on the first time point, the second time point, and the third time point includes:
[0011] Determine a first time period between the first time point and the third time point, and determine a second time period between the second time point and the third time point;
[0012] Based on the first time period and the second time period, determine whether the functional modules in the electronic device meet the preset calibration conditions;
[0013] The step of calibrating the indication time of the functional module in response to the functional module meeting the preset calibration conditions, and obtaining the calibrated indication time, includes:
[0014] In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated based on the first time and the second time to obtain the calibrated indication time.
[0015] In some embodiments, determining whether the functional modules within the electronic device meet preset calibration conditions based on the first time period and the second time period includes:
[0016] If the difference between the first time period and the second time period is greater than or equal to the first threshold, it is determined that the functional module in the electronic device meets the preset calibration conditions.
[0017] In some embodiments, determining whether the functional modules within the electronic device meet preset calibration conditions based on the first time period and the second time period includes:
[0018] If the difference between the first time period and the second time period is less than a first threshold, it is determined that the functional module in the electronic device does not meet the preset calibration conditions.
[0019] In some embodiments, the method further includes:
[0020] In response to the fact that the functional module does not meet the preset calibration conditions, the indication time of the functional module is kept unchanged.
[0021] In some embodiments, the second calibration event includes: a startup event of the electronic device;
[0022] The method further includes:
[0023] In response to the startup event of the electronic device, the system time of the electronic device is calibrated to the third time point;
[0024] The indication time of the functional module is calibrated based on the third time point to obtain the calibrated indication time.
[0025] In some embodiments, calibrating the indication time of the functional module based on the first time and the second time to obtain the calibrated indication time includes:
[0026] The first moment is sent to the functional module, and a fourth moment is determined when the functional module successfully receives the first moment;
[0027] Based on the second time point and the fourth time point, determine the delay duration for transmitting the first time point;
[0028] The indication time of the functional module is calibrated based on the delay duration and the first moment to obtain the calibrated indication time.
[0029] In some embodiments, sending the first moment to the functional module includes:
[0030] Determine the fifth moment when the first calibration event is triggered;
[0031] Based on the fifth time point and the second time point, the calibration delay of the system time is determined;
[0032] If the calibration delay is less than the second threshold, the first moment is sent to the functional module;
[0033] The method further includes:
[0034] If the calibration delay is greater than or equal to the second threshold, the first moment will not be sent to the functional module.
[0035] According to a second aspect of the present disclosure, a log generation method is provided, comprising:
[0036] The operation log of the functional module is generated based on the calibrated indication time;
[0037] The calibrated indicated time is obtained by any of the time calibration methods described in the first aspect above.
[0038] In some embodiments, the operation log of the function module based on the calibrated indication time includes:
[0039] In response to detecting the generation event of the runtime log, determine the sixth moment that triggered the generation event;
[0040] Based on the sixth time point and the calibrated indication time, the printing time of the operation log is determined, and the operation log is generated based on the printing time.
[0041] According to a third aspect of the present disclosure, a time calibration apparatus is provided, comprising:
[0042] The execution module is configured to, in response to the electronic device detecting a first calibration event, calibrate the system time of the electronic device to a first moment, and determine a second moment in response to the first calibration event;
[0043] The acquisition module is configured to acquire the third moment to which the electronic device has been calibrated based on the second calibration event; wherein the second calibration event is the calibration event preceding the first calibration event;
[0044] The judgment module is configured to determine whether the functional modules in the electronic device meet the preset calibration conditions based on the first time, the second time, and the third time.
[0045] The first calibration module is configured to calibrate the indication time of the functional module in response to the functional module meeting the preset calibration conditions, so as to obtain the calibrated indication time.
[0046] In some embodiments, the determining module includes:
[0047] The first determining module is configured to determine a first time period between the first time point and the third time point, and to determine a second time period between the second time point and the third time point;
[0048] The second determining module is configured to determine whether the functional modules in the electronic device meet the preset calibration conditions based on the first time period and the second time period.
[0049] The first calibration module is specifically configured as follows:
[0050] In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated based on the first time and the second time to obtain the calibrated indication time.
[0051] In some embodiments, the second determining module is specifically configured as follows:
[0052] If the difference between the first time period and the second time period is greater than or equal to the first threshold, it is determined that the functional module in the electronic device meets the preset calibration conditions.
[0053] In some embodiments, the second determining module is further configured to:
[0054] If the difference between the first time period and the second time period is less than a first threshold, it is determined that the functional module in the electronic device does not meet the preset calibration conditions.
[0055] In some embodiments, the apparatus further includes:
[0056] The maintenance module is configured to maintain the indication time of the functional module unchanged in response to the functional module not meeting the preset calibration conditions.
[0057] In some embodiments, the second calibration event includes: a startup event of the electronic device;
[0058] The device further includes:
[0059] The second calibration module is configured to calibrate the system time of the electronic device to the third time in response to the startup event of the electronic device;
[0060] The third calibration module is configured to calibrate the indication time of the functional module based on the third time point to obtain the calibrated indication time.
[0061] In some embodiments, the first calibration module includes:
[0062] The first sending module is configured to send the first moment to the functional module, and to determine the fourth moment when the functional module successfully receives the first moment.
[0063] The delay module is configured to determine the delay duration for transmitting the first time based on the second time and the fourth time.
[0064] The processing module is configured to calibrate the indication time of the functional module based on the delay duration and the first moment to obtain the calibrated indication time.
[0065] In some embodiments, the first sending module is specifically configured as follows:
[0066] Determine the fifth moment when the first calibration event is triggered;
[0067] Based on the fifth time point and the second time point, the calibration delay of the system time is determined;
[0068] If the calibration delay is less than the second threshold, the first moment is sent to the functional module;
[0069] The device further includes:
[0070] The second sending module is configured to refuse to send the first moment to the functional module if the calibration delay is greater than or equal to the second threshold.
[0071] According to a fourth aspect of the present disclosure, a log generation apparatus is provided, comprising:
[0072] Any of the time calibration devices mentioned in the third aspect above;
[0073] The generation module is configured to generate the operation log of the function module based on the calibrated indication time; wherein the calibrated indication time is obtained by the time calibration device.
[0074] In some embodiments, the generation module is further configured to:
[0075] In response to detecting the generation event of the runtime log, determine the sixth moment that triggered the generation event;
[0076] Based on the sixth time point and the calibrated indication time, the printing time of the operation log is determined, and the operation log is generated based on the printing time.
[0077] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising:
[0078] processor;
[0079] Memory used to store computer programs or instructions;
[0080] The processor executes the computer program or instructions to implement the steps of any of the time calibration methods in the first aspect or any of the log generation methods in the second aspect.
[0081] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, comprising:
[0082] When the computer program or instructions in the storage medium are executed by a processor, the steps of any of the time calibration methods in the first aspect or any of the log generation methods in the second aspect are implemented.
[0083] According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implement the steps of any of the time calibration methods in the first aspect or any of the log generation methods in the second aspect.
[0084] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0085] In this embodiment of the present disclosure, in response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first time and a second time in response to the first calibration event is determined; and a third time to which the electronic device is calibrated based on the second calibration event is obtained; then, based on the first time, the second time and the third time, it is determined whether the functional module in the electronic device meets the preset calibration conditions; finally, in response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time.
[0086] Since calibrating the indication time of a functional module increases the processing burden on the electronic device, this embodiment first determines whether the functional module meets the preset calibration conditions at a first, second, and third time point. Only when the functional module meets the preset calibration conditions is the indication time calibrated, avoiding invalid calibration and thus helping to reduce the processing burden and power consumption of the electronic device. Simultaneously, obtaining the calibrated indication time helps technicians locate abnormal operating data.
[0087] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0088] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0089] Figure 1 This is a flowchart illustrating a time calibration method according to an exemplary embodiment;
[0090] Figure 2a This is a schematic diagram illustrating an operational log according to an exemplary embodiment;
[0091] Figure 2b This is a schematic diagram illustrating a software architecture according to an exemplary embodiment;
[0092] Figure 3a This is a flowchart illustrating a log generation method according to an exemplary embodiment. Figure 1 ;
[0093] Figure 3b This is a flowchart illustrating a log generation method according to an exemplary embodiment (Figure 2).
[0094] Figure 4 This is a flowchart illustrating a log generation method according to an exemplary embodiment;
[0095] Figure 5a This is a block diagram illustrating a time calibration device according to an exemplary embodiment;
[0096] Figure 5b This is a block diagram illustrating a log generation apparatus according to an exemplary embodiment;
[0097] Figure 6 This is a structural block diagram of an electronic device 600 according to an exemplary embodiment. Detailed Implementation
[0098] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0099] Figure 1 This is a flowchart illustrating a time calibration method according to an exemplary embodiment, such as... Figure 1 As shown, this time calibration method mainly includes the following steps:
[0100] In step 101, in response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first time, and a second time in response to the first calibration event is determined;
[0101] In step 102, the third moment to which the electronic device was calibrated based on the second calibration event is obtained; wherein the second calibration event is the calibration event preceding the first calibration event;
[0102] In step 103, based on the first time, the second time and the third time, it is determined whether the functional modules in the electronic device meet the preset calibration conditions;
[0103] In step 104, in response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time.
[0104] It should be noted that the time calibration method proposed in this disclosure can be applied to electronic devices. Here, electronic devices can include terminal devices, such as mobile terminals or fixed terminals. Mobile terminals can include devices such as mobile phones, tablets, laptops, and wearable electronic devices. Fixed terminals can include desktop computers, smart TVs, and in-vehicle devices. In some other embodiments, the time calibration method can also be applied to applications installed on electronic devices.
[0105] In other embodiments, the time calibration method in this disclosure can be configured in a time calibration device, which can be located in an electronic device; this disclosure does not limit this. It should be noted that the execution entity in this disclosure can be a central processing unit (CPU) in the electronic device in hardware, and a related background service in the electronic device in software; this is not limited.
[0106] The application processor in this embodiment is an integrated computing chip, including a CPU, in a System on Chip (SoC) and is responsible for tasks such as running applications, image processing, or audio processing.
[0107] Here, the time calibration method proposed in this embodiment can be applied to scenarios of generating operation logs or storing operation data. For example, the operation data corresponding to the calibrated operation time can be stored in the memory of an electronic device in real time.
[0108] In some embodiments, multiple functional modules within an electronic device have operation logs. The operation logs of each functional module record information such as the operating status, error messages, or operation records of the functional module. This information is helpful for technicians to troubleshoot problems, optimize performance, and maintain the system.
[0109] Here, the operation logs differ for different functional modules. In some embodiments, when the functional module is a communication module, its operation log includes communication protocol logs, data transmission logs, and network status logs. This log information helps analyze problems during communication, such as data loss and connection issues. In other embodiments, when the functional module is a storage module, its operation log includes read / write operation logs, storage status logs, and error logs. This log information helps analyze storage performance issues, such as decreased read / write speeds and damaged storage media. In still other embodiments, when the functional module is a sensing module, its operation log includes the operation log of the sensing hub and the operation logs of each sensor managed by the sensing hub, such as the ambient light sensor operation log, magnetometer operation log, and accelerometer operation log. This log information helps analyze the interaction between the sensing hub and each sensor, such as power consumption and data transmission.
[0110] In some embodiments, the runtime log includes timestamp information to record the time when log events occurred. The accuracy of the timestamps is crucial for subsequent problem localization, performance analysis, and security assessment. Here, the timestamps can include year, month, day, hour, minute, second, and milliseconds to ensure the accuracy and traceability of the runtime log records.
[0111] The timestamps in the operation log are generated by rolling the indicated timestamps from the functional modules. If the indicated timestamps of the functional modules are inconsistent with the system time, the timestamps in the operation log will not match the actual operating time of the electronic device, thus affecting subsequent problem localization. Therefore, maintaining the accuracy and synchronization between the system time and the indicated timestamps of the functional modules is crucial for the effectiveness of the operation log.
[0112] In related technologies, for electronic devices equipped with MTK processors, after the electronic device starts up, a 10-second (S) timer and notification chain are set by the application processor. When the timer is triggered or the system wake-up notification chain is triggered, the system time is logged in the operating system kernel and sent to the functional module (e.g., Sensor Hub). After receiving the system time, Sensor Hub calibrates the indicated time of Sensor Hub to obtain the calibrated indicated time.
[0113] However, in the above scheme, the application processor (AP) allocates a separate timed task to send the system time to the sensor hub in real time. This increases the processing burden on the AP and the power consumption of the electronic devices. Meanwhile, Figure 2a This is a schematic diagram illustrating an operational log according to an exemplary embodiment, such as... Figure 2a As shown, only one operation log was generated for the indication time sent to the calibrated Sensor Hub, while no corresponding operation logs were printed for other times. This makes it difficult for technicians to locate the corresponding log when a problem occurs.
[0114] In some embodiments, the log printing function can be adjusted so that before each log printing function outputs a string, the current time corresponding to the current log printing event is calculated first, and then the current time is added to the beginning of the string. In this way, after the Sensor Hub's indication time is calibrated, the Sensor Hub's running logs at each time can be printed.
[0115] In some embodiments, after the server system powers on, during the power-on startup process of the Baseboard Management Controller (BMC), a first target log of the server system is obtained from the BMC. If the Real-Time Clock (RTC) chip is working normally, first-moment information is obtained from the RTC to synchronize the time of the BMC, thereby correcting the initial timestamp of the first target log to obtain a second target log. In this way, correcting the initial timestamp of the obtained first target log through the BMC facilitates the analysis and location of server system faults during the BMC startup process by management and maintenance personnel.
[0116] The above solution synchronizes timestamps within the application processor (AP) and does not involve multiple functional modules. Furthermore, it does not consider scenarios where the electronic device's system time is manually calibrated.
[0117] Based on this, the embodiments of this disclosure fully consider calibration events in various scenarios of electronic devices, and reduce the number of calibrations of the indication time of functional modules, so as to reduce the processing burden of electronic devices.
[0118] It is understandable that multiple calibration events will occur during the operation of electronic devices. In order to ensure the response mechanism of electronic devices, in response to the detection of the first calibration event, the system time of electronic devices can be calibrated to the first moment indicated by the first calibration event.
[0119] Here, "first moment" refers to a specific point in time, used to demonstrate the precision and specificity of the time. For example, "first moment" is 12 o'clock. All subsequent mentions of "moment" also refer to specific points in time.
[0120] Here, the first calibration event is triggered at any time during the operation of the electronic device. The first calibration event may include a modification event of the system time of the electronic device, a modification event of the time of the application processor in the electronic device, and / or an access event of the electronic device accessing a time server, etc. This disclosure does not limit this.
[0121] Different first calibration events may indicate different first moments. In some embodiments, when the first calibration event is an access event of an electronic device accessing a time server (e.g., an NTP server), the first moment is the world time corresponding to the time server. In other embodiments, when the first calibration event is a modification event of the system time of an electronic device, the first moment is any time modified by the user.
[0122] It should be noted that before the first calibration event is triggered, there may be a situation where the indicated time of the functional module has been calibrated at least once. In order to reduce the processing burden of the system, when the system time of the electronic device is detected to be calibrated to the first moment indicated by the first calibration event, it can be determined whether the functional module meets the preset calibration event. If the functional module meets the preset calibration event, the indicated time of the functional module can be calibrated.
[0123] Here, the preset calibration event is the event where the current indicated time of the functional module does not match the first moment.
[0124] It should be explained that when the first calibration event is triggered, the indication time of the functional module is synchronized with the third time indicated by the previous calibration event. Therefore, the second time of responding to the first calibration event can be obtained, and based on the third time, the second time, and the first time, it can be determined whether the functional module meets the preset calibration event.
[0125] Here, the calibration event preceding the first calibration event can be referred to as the second calibration event. Since the second calibration event is the calibration event preceding the first calibration event, it can be triggered at any moment during the operation of the electronic device. For example, the second calibration event may include a modification event of the system time of the electronic device and / or an access event of the electronic device accessing a time server. The second calibration event may also be triggered at the startup moment of the electronic device. For example, the second calibration event may include a startup event of the electronic device, wherein the startup event indicates that the state of the electronic device switches from the power-off state to the power-on state.
[0126] In some embodiments, the electronic device contains a timer. After the electronic device is started, the internal counter of the timer accumulates a count according to the period of the clock signal. By configuring the relationship between the timer's accumulation count and time, the duration of one accumulation can be obtained. Here, the second moment in response to the first calibration event can be obtained through the timer.
[0127] Here, the timers within the electronic device and the functional module can be kept in sync by using either a single crystal oscillator frequency divider or two identical crystal oscillators for frequency divider. In some embodiments, a high-precision, stable crystal oscillator can be selected as the clock source for the electronic device. Then, based on the clock frequency requirements of the electronic device and the functional module, a frequency divider circuit is designed to divide the high-frequency clock signal generated by the crystal oscillator into clock signals of different frequencies. These different frequency clock signals are then distributed to the electronic device and the functional module to ensure that the timers within the electronic device and the functional module remain in sync. In other embodiments, two identical crystal oscillators can be selected for the electronic device and the functional module, respectively. These two identical crystal oscillators should have the same frequency, accuracy, and stability specifications. Independent and identical crystal oscillator circuits are then configured for the electronic device and the functional module to reduce clock deviations caused by differences in the crystal oscillator circuits. Finally, a monitoring mechanism can be designed to monitor the frequency deviation and stability of the two crystal oscillators in real time.
[0128] In some embodiments, since both the second calibration event and the first calibration event are access events of the electronic device accessing the time server, after the second calibration event is triggered, the indicated time of the functional module is calibrated to World Time (i.e., the third moment mentioned above). From the response of the second calibration event until the triggering of the first calibration event, the indicated time of the functional module rolls according to World Time. When the triggering of the first calibration event is detected, the first moment indicated by the first calibration event is World Time, and the indicated time of the functional module is also World Time. Therefore, by obtaining the second moment of the response to the first calibration event, and based on the third moment, the second moment, and the first moment, it can be determined that the functional module does not meet the preset calibration event. This avoids the situation where the indicated time of the functional module is synchronized with the system time when both calibration events are network calibrations, but the indicated time of the functional module is still calibrated, which helps to reduce the processing burden of the electronic device.
[0129] Here, since the second moment represents the triggering time of the response to the first calibration event, the first difference between the third moment and the second moment can represent the actual runtime of the functional module from the triggering of the second calibration event to the response of the first calibration event; while the second difference between the third moment and the first moment can represent the target runtime of the functional module from the triggering of the second calibration event to the response of the first calibration event. By determining the difference between the first difference and the second difference, it can be determined whether the functional module meets the preset calibration requirements.
[0130] Understandably, if the function module meets the preset calibration conditions, and it is determined that the indicated time of the function module is not synchronized with the calibrated system time (i.e., the first moment), the indicated time can be calibrated to obtain the calibrated indicated time, so that the calibrated indicated time is synchronized with the first moment, so as to obtain effective operating data.
[0131] In some embodiments, the time calibration method described above can be applied to software architectures. Figure 2b This is a schematic diagram illustrating a software architecture according to an exemplary embodiment, such as... Figure 2b As shown in the diagram, the application processor (AP) and the sensor hub reside in different processing layers within the architecture. The AP manages the application layer (System Apps), framework layer, underlying support libraries (Native C / C++ Libraries), hardware abstraction layer (HAL), and operating system kernel (Linux kernel). Furthermore, the application processor and sensor hub share a single timer.
[0132] In this embodiment of the present disclosure, in response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first time and a second time in response to the first calibration event is determined; and a third time to which the electronic device is calibrated based on the second calibration event is obtained; then, based on the first time, the second time and the third time, it is determined whether the functional module in the electronic device meets the preset calibration conditions; finally, in response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time.
[0133] Since calibrating the indication time of a functional module increases the processing burden on the electronic device, this embodiment first determines whether the functional module meets the preset calibration conditions at a first, second, and third time point. Only when the functional module meets the preset calibration conditions is the indication time calibrated, avoiding invalid calibration and thus helping to reduce the processing burden and power consumption of the electronic device. Simultaneously, obtaining the calibrated indication time helps technicians locate abnormal operating data.
[0134] In some embodiments, determining whether a functional module within an electronic device meets preset calibration conditions based on a first time point, a second time point, and a third time point includes:
[0135] Determine the first time interval between the first and third time intervals, and determine the second time interval between the second and third time intervals;
[0136] Based on the first and second time periods, determine whether the functional modules in the electronic device meet the preset calibration conditions;
[0137] In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time, including:
[0138] In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated based on the first time and the second time to obtain the calibrated indication time.
[0139] It is understandable that, since the second moment represents the response time that triggers the first calibration event, by determining the first time period between the third moment and the second moment, the actual runtime of the functional module from the triggering of the second calibration event to the response of the first calibration event can be obtained; and by determining the second time period between the third moment and the first moment, the planned runtime of the functional module from the triggering of the second calibration event to the response of the first calibration event can be obtained.
[0140] Here, the first time period refers to the length of time from the first moment to the second moment, and the second time period refers to the length of time from the third moment to the first moment. For example, if the first moment is 9:00 AM and the second moment is 11:00 AM, then the first time period is 2 hours.
[0141] Therefore, determining whether the functional modules within the electronic device meet the preset calibration conditions based on the first and second time periods can be understood as comparing the actual runtime with the planned runtime, and determining whether the functional modules meet the preset calibration conditions based on the comparison results.
[0142] Specifically, when the difference between the actual runtime and the planned runtime is small, it can be determined that the current indication time of the functional module is synchronized with the first moment indicated by the first calibration event. At this time, it is determined that the functional module does not meet the preset calibration event, so there is no need to calibrate the indication time of the functional module, which helps to reduce the processing burden of electronic devices.
[0143] When the difference between the actual runtime and the planned runtime is large, it can be determined that the current indicated time of the functional module is not synchronized with the first moment indicated by the first calibration event. At this time, it is determined that the functional module meets the preset calibration event, so the indicated time of the functional module needs to be calibrated so that the indicated time of the functional module is synchronized with the system time.
[0144] It should be noted that, under the condition that the functional module meets the preset calibration conditions, the indication time of the functional module can be calibrated at the first and second moments to obtain the calibrated indication time, so as to ensure that the calibrated indication time is synchronized with the system time, thereby ensuring the validity of the operating data.
[0145] In some embodiments, the indication time of the functional module can be calculated by an independent clock source of the functional module or processed by the system clock. If the indication time of the functional module can be obtained from an independent clock source (e.g., a GPS module, a high-precision clock chip, etc.), the independent clock source can be synchronized with the system clock through software or hardware interface. If the indication time of the functional module is obtained from the system clock, the indication time can be synchronized with the system time by performing frequency division or frequency multiplication on the system clock.
[0146] In some embodiments, when the functional module meets the preset calibration conditions, the first moment can be directly synchronized to the functional module, that is, the indicated time of the functional module is updated to the first moment, and the operating data of the functional module is obtained by rolling according to the first moment.
[0147] In other embodiments, when the functional module meets the preset calibration conditions, considering the synchronization delay between the system time and the indication time, the target time for triggering the calibration event of the functional module can be determined. Based on the target time and the second moment, the synchronization delay time is determined. Then, based on the synchronization delay time and the first moment, the indication time of the functional module is calibrated to obtain the calibrated indication time.
[0148] In this embodiment, after determining the first time period and the second time period, it is determined whether the functional module within the electronic device meets the preset calibration conditions based on the first and second time periods. This improves the accuracy of determining whether the functional module meets the preset calibration conditions and avoids increasing the processing burden of the electronic device due to invalid calibration. When the functional module within the electronic device meets the preset calibration conditions, the indication time of the functional module can be calibrated based on the first and second time periods to obtain the calibrated indication time, thereby ensuring the accuracy of the calibrated indication time.
[0149] In some embodiments, determining whether a functional module within an electronic device meets preset calibration conditions based on a first time period and a second time period includes:
[0150] If the difference between the first time period and the second time period is greater than or equal to the first threshold, it is determined that the functional module in the electronic device meets the preset calibration conditions.
[0151] It should be noted that, in order to improve the accuracy of determining whether a functional module meets the preset calibration conditions, a first threshold can be set. The difference between the first time period and the second time period is compared with the first threshold, and the functional module is determined to meet the preset calibration conditions based on the comparison result.
[0152] Here, the first threshold can be set arbitrarily according to the requirements, for example, it can be 1 millisecond (ms), and this embodiment of the disclosure does not limit it.
[0153] It is understandable that when the difference between the first time period and the second time period is greater than or equal to the first threshold, it is determined that the current indication time of the functional module is not synchronized with the first moment indicated by the first calibration event, and thus the functional module in the electronic device meets the preset calibration conditions.
[0154] In this embodiment of the disclosure, by setting a first threshold, the difference between the first time period and the second time period is compared with the first threshold to determine whether the functional module in the electronic device meets the preset calibration conditions, thereby improving the accuracy of determining whether the functional module meets the preset calibration conditions.
[0155] In some embodiments, determining whether a functional module within an electronic device meets preset calibration conditions based on a first time period and a second time period includes:
[0156] If the difference between the first time period and the second time period is less than the first threshold, it is determined that the functional module in the electronic device does not meet the preset calibration conditions.
[0157] It is understandable that when the difference between the first time period and the second time period is less than the first threshold, it is determined that the current indication time of the functional module is synchronized with the first moment indicated by the first calibration event, and thus it is determined that the functional module in the electronic device does not meet the preset calibration conditions.
[0158] Here, the first threshold can be set arbitrarily according to requirements, for example, it can be 3ms, but this embodiment does not limit it.
[0159] In this embodiment of the present disclosure, if the difference between the first time period and the second time period is less than a first threshold, it is determined that the functional module in the electronic device does not meet the preset calibration conditions, thereby avoiding invalid calibration and thus helping to reduce the processing burden of the electronic device.
[0160] In some embodiments, the method further includes:
[0161] In response to the functional module not meeting the preset calibration conditions, the indication time of the functional module remains unchanged.
[0162] It is understandable that if the functional module does not meet the preset calibration conditions, there is no need to calibrate the indication time of the functional module, and the indication time of the functional module remains unchanged.
[0163] In this embodiment of the disclosure, when it is determined that the functional module does not meet the preset calibration conditions, there is no need to calibrate the indication time of the functional module, which can reduce the processing burden of the electronic device and thus help reduce the power consumption of the electronic device.
[0164] In some embodiments, the second calibration event includes: a startup event of the electronic device;
[0165] The method also includes:
[0166] In response to the startup event of the electronic device, the system time of the electronic device is calibrated to the third moment;
[0167] The indication time of the functional module is calibrated based on the third time point to obtain the calibrated indication time.
[0168] Understandably, since the second calibration event is the preceding calibration event of the first calibration event, the second calibration event can include the startup event of the electronic device. Because the various functional modules within the electronic device also restart after startup, the indicated time of the functional modules can be calibrated to synchronize the calibrated indicated time with the system time.
[0169] Here, a startup event refers to an event in which an electronic device switches from a powered-off state to a powered-on state.
[0170] In some embodiments, after the system time of the electronic device is calibrated to the third time, the indication time of the functional module can be calibrated to the third time through a synchronization mechanism to obtain the calibrated indication time.
[0171] In other embodiments, taking into account the delay duration of the application processor transmitting the third time, after the system time of the electronic device is calibrated to the third time, the calibrated indication time can be determined based on the third time and the delay duration of transmitting the third time, thereby improving the accuracy of the calibrated indication time.
[0172] In this embodiment of the present disclosure, when a startup event of an electronic device is detected, a second calibration event is determined to be triggered, the system time of the electronic device is calibrated to a third time, and the indication time of the functional module is calibrated based on the third time to obtain the calibrated indication time, so that the calibrated indication time is synchronized with the system time to ensure the validity of the operating data.
[0173] In some embodiments, the indication time of the functional module is calibrated based on a first time point and a second time point to obtain a calibrated indication time, including:
[0174] The first moment is sent to the functional module, and the fourth moment is confirmed when the functional module successfully receives the first moment;
[0175] Based on the second and fourth time points, determine the delay duration for transmitting the first time point;
[0176] The indication time of the functional module is calibrated based on the delay duration and the first moment to obtain the calibrated indication time.
[0177] It should be noted that, in order to improve the accuracy of the indication time of the calibration function module, the first moment can be sent to the function module first to confirm that the function module has successfully received the first moment at the fourth moment; and based on the second moment and the fourth moment, the delay time for transmitting the first moment can be determined. In this way, by determining the delay time, it is beneficial to improve the accuracy of the calibration indication time.
[0178] Here, the application processor can first obtain the first moment, and then, upon obtaining the first moment, it can send the first moment to the functional module, such as the sensor hub, through inter-core communication or bus communication.
[0179] In some embodiments, since the second moment represents the moment of response to the first calibration event and the fourth moment represents the moment when the functional module successfully receives the first moment, by calculating the difference between the second moment and the fourth moment, the time consumed in transmitting the first moment after responding to the first calibration event and sending the first moment to the functional module can be obtained, that is, the delay time for transmitting the first moment.
[0180] For example, the timer in the application processor and the timer in the functional module share a clock source (i.e., the two timers are controlled by dividing a single crystal oscillator). The formula for calculating the delay duration is:
[0181] td = t2 - t1(1);
[0182] In formula (1), td is the delay duration, t1 is the second time point, and t2 is the fourth time point.
[0183] In another example, the timer within the application processor and the timer within the functional module each have independent clock sources. Considering the delay error between the various independent clock sources, the formula for calculating the delay duration is:
[0184] td = t2 - t1 + Δt(2);
[0185] In formula (2), td is the delay duration, t1 is the second time point, t2 is the fourth time point, and Δt is the delay error between each independent clock source. Here, Δt represents the time difference between the application processor startup and the functional module startup. Δt can be a positive or negative value, and this embodiment of the present disclosure does not limit it.
[0186] Understandably, after obtaining the delay duration, the indication time of the functional module can be calibrated to the sum of the delay duration and the first moment, so that the calibrated indication time is synchronized with the system time.
[0187] In some embodiments, since the latency can characterize the transmission time of inter-core communication or bus communication, and the magnitude of the transmission time can characterize the real-time performance of data transmission between the application processor and the functional module, the latency can be printed on the running log of the functional module to facilitate developers in analyzing the real-time performance of data transmission.
[0188] Here, the low-level interaction of inter-core communication can be implemented based on shared memory, including but not limited to Symmetric Multiprocessor to Peer Interrupt (SMP2P) and Qualcomm Message Interface (QMI). Meanwhile, bus communication methods include, but are not limited to, Inter-Integrated Circuit (IIC), Serial Peripheral Interface (SPI), and Universal Asynchronous Receiver / Transmitter (UART) for asynchronous communication.
[0189] In some embodiments, if the functional module is a sensor hub, the AP can send parameters such as screen brightness, frame rate, and / or HBM status to the sensor hub. This allows the sensors managed by the sensor hub to report the corresponding values of each parameter to the AP, thereby improving the reliability and effectiveness of the interaction between the AP and the sensor hub. Here, when the AP sends data to the sensor hub initially, it can also send the aforementioned parameters together. This reduces the frequency or number of inter-core / bus communications, which helps reduce the power consumption of the electronic device.
[0190] In this embodiment of the disclosure, by sending the first moment to the functional module to determine the fourth moment when the functional module successfully receives the first moment, and then determining the delay duration of transmitting the first moment based on the second moment and the fourth moment, the indication information is finally calibrated based on the delay duration and the first moment to obtain the calibrated indication time, which helps to improve the accuracy of the calibrated indication time and ensures that the calibrated indication time is highly synchronized with the system time.
[0191] In some embodiments, sending the first moment to the functional module includes:
[0192] Determine the fifth moment that triggers the first calibration event;
[0193] Based on the fifth and second time points, determine the calibration delay of the system time;
[0194] If the calibration delay is less than the second threshold, the first moment will be sent to the functional module;
[0195] The method also includes:
[0196] If the calibration delay is greater than or equal to the second threshold, the first moment will not be sent to the functional module.
[0197] It should be noted that since sending the first moment to the functional module will consume power in the electronic device, the first moment can be sent to the functional module only when the system time calibration delay meets the preset conditions. This can improve the effectiveness of sending the first moment, avoid the problem of sending the first moment multiple times, and help reduce the processing burden of the electronic device.
[0198] Understandably, a second threshold can be preset. First, based on the difference between the fifth moment when the first calibration event is triggered and the second moment when the first calibration event is responded to, the calibration delay of the system time can be determined. Then, the calibration delay and the second threshold can be compared to determine whether the first moment should be sent to the functional module.
[0199] Since the second moment represents the time when the application processor acquires the first moment, and the fifth moment represents the time when the first calibration event is triggered, when the calibration delay is less than the second threshold, it can be determined that the application processor can acquire the first moment in time, and thus the application processor can send the first moment to the functional module. However, when the calibration delay is greater than or equal to the second threshold, it can be determined that the application processor cannot acquire the first moment in time, that is, there is a deviation between the first moment acquired by the application processor and the system time, and thus the application processor refuses to send the first moment to the functional module.
[0200] Here, the second threshold can be set according to requirements, for example, it can be set to 1ms, but this embodiment does not limit it.
[0201] In some embodiments, if the calibration delay is greater than or equal to a second threshold, the application processor refuses to send the first moment to the functional module. The application processor continues to acquire the first moment until the calibration delay is less than the second threshold before sending the first moment to the functional module. Here, the first moment is a change value.
[0202] In this embodiment of the disclosure, by setting a second threshold, if the system time calibration delay is greater than or equal to the second threshold, the first moment will not be sent to the functional module; if the system time calibration delay is less than the second threshold, the first moment will be sent to the functional module. This reduces the number of times the first moment is transmitted, which helps to alleviate the processing burden on the electronic device and reduce its power consumption.
[0203] Figure 3a This is a flowchart illustrating a log generation method according to an exemplary embodiment. Figure 1 ,like Figure 3a As shown, this log generation method mainly includes the following steps:
[0204] In step 301, the operation log of the functional module is generated based on the calibrated indication time;
[0205] The calibrated indicated time is obtained by any of the above time calibration methods.
[0206] Understandably, if the function module meets the preset calibration conditions, and it is determined that the indicated time of the function module is not synchronized with the calibrated system time (i.e., the first moment), the indicated time can be calibrated so that the calibrated indicated time is synchronized with the first moment, so as to generate a valid operation log.
[0207] In some embodiments, since the operation log is generated in real time during the operation of the functional module, in order to ensure the validity of the operation log, the time of the event that triggers the generation of the operation log can be determined, and then the operation log is generated based on the calibrated indication time and the time of the event that triggers the generation of the operation log.
[0208] In this embodiment of the present disclosure, in response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first time, and a second time in response to the first calibration event is determined; and a third time to which the electronic device is calibrated based on the second calibration event is obtained; then, based on the first time, the second time, and the third time, it is determined whether the functional module in the electronic device meets the preset calibration conditions; then, in response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time; finally, the operation log of the functional module is generated based on the calibrated indication time.
[0209] In this embodiment of the disclosure, after calibrating the indication time of the functional module, the operation log of the functional module can be generated based on the calibrated indication time, so that each timestamp in the operation log corresponds to the system time, which is beneficial for developers to trace abnormal operation information and analyze abnormal operation problems.
[0210] In some embodiments, the operation log of the functional module is generated based on the calibrated indication time, including:
[0211] In response to the detection of a runtime log generation event, determine the sixth moment that triggered the generation event;
[0212] Based on the sixth time point and the calibrated indication time, the printing time of the operation log is determined, and the operation log is generated based on the printing time.
[0213] Understandably, since the operation log is generated in real time during the operation of the functional module, in order to ensure the validity of the operation log, the sixth moment that triggers the generation of the operation log can be determined, and the printing time of the operation log can be obtained based on the sixth moment and the calibrated indication time.
[0214] In some embodiments, the sum between the sixth time point and the calibrated indication time can be calculated, and the sum can be determined as the printing time of the runtime log.
[0215] Here, the sixth time point can be obtained by accumulating counts from an independent clock source, or it can be obtained by accumulating counts from the same clock source corresponding to the second and fourth times. That is, the various processors of the electronic device share a timer.
[0216] For example, after the first moment is sent to the functional module, the calibrated indication time is obtained based on the sum of the first moment and the delay duration; while the functional module is successfully receiving the first moment, the operation log is generated in real time, therefore the formula for calculating the printing time needs to be:
[0217] t R = td + tap + t3 - t2(3);
[0218] In formula (3), t R td represents the printing time, td represents the delay duration, tap represents the first moment, t3 represents the sixth moment, and t2 represents the fourth moment.
[0219] Substituting formula (1) into formula (3), the formula for calculating printing time is:
[0220] t R =tap+t3-t1(4);
[0221] In formula (4), t R The values represent the printing times: tap represents the first time point, t3 represents the sixth time point, and t1 represents the second time point.
[0222] For example, Figure 3b This is a flowchart illustrating a log generation method according to an exemplary embodiment, as shown in Figure 2. Figure 3b As shown, the log generation method includes:
[0223] In step 310, the system time is calibrated to a first moment, and a second moment in response to the first calibration event is determined.
[0224] In step 311, the first moment is sent to the functional module.
[0225] In step 312, it is determined that the functional module has successfully received the fourth moment of the first moment.
[0226] In step 313, the delay duration for transmitting the first time is determined based on the second time and the fourth time.
[0227] In step 314, the printing time is determined based on the delay duration, the sixth moment when the generation event is triggered, and the first moment.
[0228] In step 315, a running log is generated based on the printing time.
[0229] In this embodiment of the disclosure, when a log generation event is detected, the sixth moment that triggers the log generation event is determined, and the printing time of the operation log is determined based on the sixth moment and the calibrated indication time. Then, the operation log is generated based on the printing time to ensure the validity and real-time performance of the operation log.
[0230] Figure 4 This is a flowchart illustrating a log generation method according to an exemplary embodiment, as shown in Figure 3. Figure 4 As shown, the log generation method includes:
[0231] In step 401, in response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first time, and a second time in response to the first calibration event is determined.
[0232] In step 402, the third moment to which the electronic device was calibrated based on the second calibration event is obtained.
[0233] Here, the second calibration event is the calibration event preceding the first calibration event.
[0234] In step 403, a first time period between the first time point and the third time point is determined, and a second time period between the second time point and the third time point is determined.
[0235] In step 404, it is determined whether the difference between the first time period and the second time period is greater than or equal to the first threshold.
[0236] In some embodiments, if the difference between the first time period and the second time period is greater than or equal to the first threshold, it is determined that the functional module in the electronic device meets the preset calibration conditions, and then step 405 is executed.
[0237] In other embodiments, if the difference between the first time period and the second time period is less than a first threshold, it is determined that the functional module in the electronic device does not meet the preset calibration conditions, and then step 410 is executed.
[0238] In step 405, it is determined that the functional modules within the electronic device meet the preset calibration conditions, and the calibration delay of the system time is obtained.
[0239] In some embodiments, in response to a functional module within an electronic device meeting preset calibration conditions, a fifth moment is determined to trigger a first calibration event; and based on the fifth moment and a second moment, a calibration delay of the system time is determined.
[0240] In step 406, it is determined whether the calibration delay of the system time is less than the second threshold.
[0241] In some embodiments, if the system time calibration delay is less than the second threshold, then step 407 is executed.
[0242] In some embodiments, if the system time calibration delay is greater than or equal to the second threshold, then step 409 is executed.
[0243] In step 407, the first moment is sent to the functional module.
[0244] In step 408, the indication time of the functional module is calibrated based on the first time and the second time, and the operation log of the functional module is generated based on the calibrated indication time.
[0245] In step 409, the first moment is refused to be sent to the functional module.
[0246] In some embodiments, step 405 is performed after the first moment is refused to be sent to the functional module.
[0247] In step 410, the indication time of the functional module is kept unchanged, and an operation log is generated based on the indication time.
[0248] On the one hand, since calibrating the indication time of the functional module increases the processing burden of the electronic device, the embodiments of this disclosure first determine whether the functional module meets the preset calibration conditions through the first time, the second time and the third time. If the functional module meets the preset calibration conditions, the indication time of the functional module is then calibrated, thus avoiding invalid calibration, thereby helping to reduce the processing burden of the electronic device and reduce the power consumption of the electronic device.
[0249] On the other hand, after calibrating the indication time of the functional module, the operation log of the functional module can be generated based on the calibrated indication time, so that each timestamp in the operation log corresponds to the system time, which is beneficial for developers to trace abnormal operation information and analyze abnormal operation problems.
[0250] Figure 5a This is a block diagram illustrating a time calibration device according to an exemplary embodiment, such as... Figure 5a As shown, the time calibration device 500 includes:
[0251] The execution module 501 is configured to, in response to the electronic device detecting a first calibration event, calibrate the system time of the electronic device to a first moment, and determine a second moment in response to the first calibration event;
[0252] The acquisition module 502 is configured to acquire the third moment to which the electronic device has been calibrated based on the second calibration event; wherein the second calibration event is the calibration event preceding the first calibration event;
[0253] The judgment module 503 is configured to determine whether the functional modules in the electronic device meet the preset calibration conditions based on the first time, the second time and the third time.
[0254] The first calibration module 504 is configured to calibrate the indication time of the functional module in response to the functional module meeting the preset calibration conditions, so as to obtain the calibrated indication time.
[0255] In some embodiments, the determining module 503 includes:
[0256] The first determining module is configured to determine a first time period between the first time point and the third time point, and to determine a second time period between the second time point and the third time point;
[0257] The second determining module is configured to determine whether the functional modules in the electronic device meet the preset calibration conditions based on the first time period and the second time period.
[0258] The first calibration module 504 is specifically configured as follows:
[0259] In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated based on the first time and the second time to obtain the calibrated indication time.
[0260] In some embodiments, the second determining module is specifically configured as follows:
[0261] If the difference between the first time period and the second time period is greater than or equal to the first threshold, it is determined that the functional module in the electronic device meets the preset calibration conditions.
[0262] In some embodiments, the second determining module is further configured to:
[0263] If the difference between the first time period and the second time period is less than a first threshold, it is determined that the functional module in the electronic device does not meet the preset calibration conditions.
[0264] In some embodiments, the device 500 further includes:
[0265] The maintenance module is configured to maintain the indication time of the functional module unchanged in response to the functional module not meeting the preset calibration conditions.
[0266] In some embodiments, the second calibration event includes: a startup event of the electronic device;
[0267] The device 500 further includes:
[0268] The second calibration module is configured to calibrate the system time of the electronic device to the third time in response to the startup event of the electronic device;
[0269] The third calibration module is configured to calibrate the indication time of the functional module based on the third time point to obtain the calibrated indication time.
[0270] In some embodiments, the first calibration module 504 includes:
[0271] The first sending module is configured to send the first moment to the functional module, and to determine the fourth moment when the functional module successfully receives the first moment.
[0272] The delay module is configured to determine the delay duration for transmitting the first time based on the second time and the fourth time.
[0273] The processing module is configured to calibrate the indication time of the functional module based on the delay duration and the first moment to obtain the calibrated indication time.
[0274] In some embodiments, the first sending module is specifically configured as follows:
[0275] Determine the fifth moment when the first calibration event is triggered;
[0276] Based on the fifth time point and the second time point, the calibration delay of the system time is determined;
[0277] If the calibration delay is less than the second threshold, the first moment is sent to the functional module;
[0278] The device 500 further includes:
[0279] The second sending module is configured to refuse to send the first moment to the functional module if the calibration delay is greater than or equal to the second threshold.
[0280] Figure 5b This is a block diagram illustrating a log generation apparatus according to an exemplary embodiment, such as... Figure 5b As shown, the log generation device 510 includes:
[0281] Any of the above-mentioned time calibration devices 500;
[0282] The generation module 511 is configured to generate the operation log of the function module based on the calibrated indication time; wherein the calibrated indication time is obtained by the time calibration device 500.
[0283] In some embodiments, the generation module 511 is further configured to:
[0284] In response to detecting the generation event of the runtime log, determine the sixth moment that triggered the generation event;
[0285] Based on the sixth time point and the calibrated indication time, the printing time of the operation log is determined, and the operation log is generated based on the printing time.
[0286] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0287] Figure 6 This is a structural block diagram illustrating an electronic device 600 according to an exemplary embodiment. For example, device 600 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0288] Reference Figure 6 The device 600 may include one or more of the following components: processing component 602, memory 604, power supply component 606, multimedia component 608, audio component 610, input / output (I / O) interface 612, sensor component 614, and communication component 616.
[0289] Processing component 602 typically controls the overall operation of device 600, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0290] Memory 604 is configured to store various types of data to support operation of device 600. Examples of such data include at least one of the following: instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, and videos. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0291] Power supply component 606 provides power to various components of device 600. Power supply component 606 may include at least one of the following: a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 600.
[0292] Multimedia component 608 includes a screen that provides an output interface between device 600 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0293] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
[0294] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0295] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of device 600. For example, sensor assembly 614 may detect the on / off state of device 600, the relative positioning of components such as the display and keypad of device 600, changes in the position of device 600 or one of its components, the presence or absence of user contact with device 600, orientation or acceleration / deceleration of device 600, and temperature changes of device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.
[0296] Communication component 616 is configured to facilitate wired or wireless communication between device 600 and other devices. Device 600 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.
[0297] In an exemplary embodiment, device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0298] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including executable instructions or a computer program, which can be executed by the processor 620 of the device 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0299] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of a mobile terminal, enables the mobile terminal to perform any of the time calibration methods or any of the log generation methods described in the embodiments of this disclosure. For example, the time calibration method includes:
[0300] In response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first moment, and a second moment in response to the first calibration event is determined;
[0301] The third moment to which the electronic device has been calibrated based on the second calibration event is obtained; wherein the second calibration event is the calibration event preceding the first calibration event;
[0302] Based on the first, second, and third moments, determine whether the functional modules within the electronic device meet the preset calibration conditions;
[0303] In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time.
[0304] For example, the log generation method includes:
[0305] The operation log of the functional module is generated based on the calibrated indication time;
[0306] The calibrated indicated time is obtained by any of the above time calibration methods.
[0307] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the time calibration methods or log generation methods described above in this disclosure.
[0308] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0309] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A time calibration method, characterized in that, The method includes: In response to the electronic device detecting a first calibration event, the system time of the electronic device is calibrated to a first moment, and a second moment in response to the first calibration event is determined; The third moment to which the electronic device was calibrated based on the second calibration event is obtained; wherein the second calibration event is the calibration event preceding the first calibration event; Based on the first time point, the second time point, and the third time point, determine whether the functional modules in the electronic device meet the preset calibration conditions; In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated to obtain the calibrated indication time.
2. The method according to claim 1, characterized in that, The step of determining whether the functional modules within the electronic device meet preset calibration conditions based on the first time point, the second time point, and the third time point includes: Determine a first time period between the first time point and the third time point, and determine a second time period between the second time point and the third time point; Based on the first time period and the second time period, determine whether the functional modules in the electronic device meet the preset calibration conditions; The step of calibrating the indication time of the functional module in response to the functional module meeting the preset calibration conditions, and obtaining the calibrated indication time, includes: In response to the functional module meeting the preset calibration conditions, the indication time of the functional module is calibrated based on the first time and the second time to obtain the calibrated indication time.
3. The method according to claim 2, characterized in that, The step of determining whether the functional modules within the electronic device meet preset calibration conditions based on the first time period and the second time period includes: If the difference between the first time period and the second time period is greater than or equal to the first threshold, it is determined that the functional module in the electronic device meets the preset calibration conditions.
4. The method according to claim 2, characterized in that, The step of determining whether the functional modules within the electronic device meet preset calibration conditions based on the first time period and the second time period includes: If the difference between the first time period and the second time period is less than a first threshold, it is determined that the functional module in the electronic device does not meet the preset calibration conditions.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: In response to the fact that the functional module does not meet the preset calibration conditions, the indication time of the functional module is kept unchanged.
6. The method according to any one of claims 1 to 4, characterized in that, The second calibration event includes: the startup event of the electronic device; The method further includes: In response to the startup event of the electronic device, the system time of the electronic device is calibrated to the third time point; The indication time of the functional module is calibrated based on the third time point to obtain the calibrated indication time.
7. The method according to claim 2, characterized in that, The calibration of the indication time of the functional module based on the first time point and the second time point to obtain the calibrated indication time includes: The first moment is sent to the functional module, and a fourth moment is determined when the functional module successfully receives the first moment; Based on the second time point and the fourth time point, determine the delay duration for transmitting the first time point; The indication time of the functional module is calibrated based on the delay duration and the first moment to obtain the calibrated indication time.
8. The method according to claim 7, characterized in that, Sending the first moment to the functional module includes: Determine the fifth moment when the first calibration event is triggered; Based on the fifth time point and the second time point, the calibration delay of the system time is determined; If the calibration delay is less than the second threshold, the first moment is sent to the functional module; The method further includes: If the calibration delay is greater than or equal to the second threshold, the first moment will not be sent to the functional module.
9. A log generation method, characterized in that, The method includes: The operation log of the functional module is generated based on the calibrated indication time; The calibrated indicated time is obtained by the time calibration method according to any one of claims 1 to 8.
10. The method according to claim 9, characterized in that, The operation log of the function module that generates the indication time based on the calibrated time includes: In response to detecting the generation event of the runtime log, determine the sixth moment that triggered the generation event; Based on the sixth time point and the calibrated indication time, the printing time of the operation log is determined, and the operation log is generated based on the printing time.
11. A time calibration device, characterized in that, The device includes: The execution module is configured to, in response to the electronic device detecting a first calibration event, calibrate the system time of the electronic device to a first moment, and determine a second moment in response to the first calibration event; The acquisition module is configured to acquire the third moment to which the electronic device has been calibrated based on the second calibration event; wherein the second calibration event is the calibration event preceding the first calibration event; The judgment module is configured to determine whether the functional modules in the electronic device meet the preset calibration conditions based on the first time, the second time, and the third time. The first calibration module is configured to calibrate the indication time of the functional module in response to the functional module meeting the preset calibration conditions, so as to obtain the calibrated indication time.
12. A log generation device, characterized in that, The device includes: The time calibration device according to claim 11; The first generation module is configured to generate the operation log of the function module based on the calibrated indication time. The calibrated indicated time is obtained by the time calibration device.
13. An electronic device, characterized in that, include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 10.
14. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 10 are implemented.
15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 10.