Time alignment method, electronic equipment and computer readable storage medium

By introducing target timer and event control registers into electronic devices, the interrupt mechanism and counting information are used to achieve alignment of power consumption values ​​and time, solving the problem of misalignment of power consumption values ​​and time in the prior art, and improving the accuracy and reliability of measurement results.

CN120029432APending Publication Date: 2025-05-23ALLYSTAR TECH SHENZHEN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510124948.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-26
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the existing power consumption measurement scheme of electronic equipment, the power consumption value is not aligned with the time, which affects the accuracy and reliability of the measurement results.

Method used

By introducing target timer and event control registers into electronic devices, the UTC time of power consumption value measurement is determined using interrupt mechanism and counting information, and the alignment of power consumption value and time is achieved.

Benefits of technology

It effectively solves the problem of misalignment of power consumption values ​​with time, improves the accuracy and reliability of measurement results, and ensures the spatial and temporal consistency of power consumption data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029432A_ABST
    Figure CN120029432A_ABST
Patent Text Reader

Abstract

The invention provides a time alignment method, electronic equipment and a computer readable storage medium, belongs to the technical field of data processing, and aims to align a measured power consumption value of the electronic equipment with a moment. The method is applied to the electronic equipment, the electronic equipment is connected with a measuring device, the measuring device is used for measuring the power consumption value of the electronic equipment, the electronic equipment comprises a target timer, and the method comprises the steps of triggering a first event in response to a first interrupt; the measuring device generates a first interruption after obtaining a target power consumption value of the electronic equipment, and the first event is used for obtaining first counting information of a target timer when the first interruption is generated; acquiring first information; the first information comprises second counting information of the target timer at a first moment and a first UTC at the first moment, and the first moment is before the generation moment of the first interruption; determining a second UTC according to the first counting information, the second counting information and the first UTC; the second UTC is the moment when the measuring device obtains the target power consumption value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a time alignment method, an electronic device, and a computer-readable storage medium. Background Art

[0002] Electronic devices generate power consumption when they are running. For example, the positioning chip of a satellite signal receiver has multiple operating conditions when it is running (for example, capturing satellite signals, tracking satellite signals, positioning, sleeping, waking up, ephemeris injection, RTK solution, RD combined inertial navigation, etc.). Under different operating conditions, the power consumption of the positioning chip will also be different.

[0003] In the existing solutions, there is a problem that the power consumption value of the electronic device measured is not aligned with the time. Summary of the invention

[0004] The present application provides a time alignment method, an electronic device, and a computer-readable storage medium, which can align the measured power consumption value of an electronic device with the time.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, a time alignment method is provided. The method is applied to an electronic device, wherein the electronic device is connected to a measuring device, the measuring device is used to measure the power consumption value of the electronic device, and the electronic device includes a target timer. The method includes: in response to a first interrupt, triggering a first event; the measuring device generates a first interrupt after obtaining the target power consumption value of the electronic device, and the first event is used to obtain first counting information of the target timer when the first interrupt is generated; obtaining first information; the first information includes second counting information of the target timer at a first moment and a first UTC of the first moment, and the first moment is before the moment when the first interrupt is generated; determining a second UTC based on the first counting information, the second counting information and the first UTC; the second UTC is the moment when the measuring device obtains the target power consumption value.

[0007] In combination with the first aspect, in certain embodiments of the first aspect, determining the second UTC based on the first counting information, the second counting information and the first UTC includes: determining a target duration; the target duration is the product of a target difference and a clock source frequency of a target timer, and the target difference is the difference between the first counting information and the second counting information; and taking the sum of the first UTC and the target duration as the second UTC.

[0008] In combination with the first aspect, in certain embodiments of the first aspect, the electronic device includes a first event control register and a first data register, and triggering a first event includes: triggering the first event control register; the first event control register is used to take a snapshot of the target timer, obtain first counting information of the target timer, and save the first counting information to the first data register.

[0009] In combination with the first aspect, in certain embodiments of the first aspect, the electronic device includes a second data register and a third data register, the second data register is used to store second counting information of the target timer at the first moment, the third data register is used to store the first UTC at the first moment, and obtaining the first information includes: obtaining the second counting information from the second data register; obtaining the first UTC from the third data register.

[0010] In combination with the first aspect, in certain embodiments of the first aspect, the method further includes: triggering a second event and a third event in response to a second interrupt at the first moment; a second interrupt is generated after the electronic device outputs a PPS signal, the second event is used to save the second counting information of the target timer at the first moment to a second data register, and the third event is used to save the first UTC at the first moment to a third data register.

[0011] In combination with the first aspect, in certain embodiments of the first aspect, the electronic device includes a second event control register, the second data register includes a counting information storage area, the counting information storage area is used to store the counting information of the target timer, and triggering the second event includes: triggering the second event control register; the second event control register is used to take a snapshot of the target timer to obtain the second counting information of the target timer, clear the data in the counting information storage area of ​​the second data register, and save the second counting information to the counting information storage area of ​​the second data register.

[0012] In combination with the first aspect, in certain embodiments of the first aspect, the electronic device includes a third event control register, the third data register includes a UTC storage area, the UTC storage area is used to store UTC, and triggering a third event includes: triggering the third event control register; the third event control register is used to obtain the first UTC, clear the data in the UTC storage area of ​​the third data register, and save the first UTC to the UTC storage area of ​​the third data register.

[0013] In a second aspect, an electronic device is provided for implementing the time alignment method of the first aspect. The electronic device includes a module, unit, or means corresponding to the method, which can be implemented by hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. The electronic device is connected to a measuring device, which is used to measure the power consumption value of the electronic device, and the electronic device includes a target timer.

[0014] In combination with the second aspect, in certain embodiments of the second aspect, the electronic device includes: an acquisition module and a processing module; the processing module is used to trigger a first event in response to a first interrupt; the measuring device generates a first interrupt after obtaining the target power consumption value of the electronic device, and the first event is used to obtain the first counting information of the target timer when the first interrupt is generated; the acquisition module is used to obtain the first information; the first information includes the second counting information of the target timer at the first moment and the first UTC of the first moment, and the first moment is before the moment when the first interrupt is generated; the processing module is also used to determine the second UTC based on the first counting information, the second counting information and the first UTC; the second UTC is the moment when the measuring device obtains the target power consumption value.

[0015] In combination with the second aspect, in certain embodiments of the second aspect, the processing module is further used to determine the second UTC based on the first counting information, the second counting information and the first UTC, including: determining a target duration; the target duration is the product of the target difference and the clock source frequency of the target timer, and the target difference is the difference between the first counting information and the second counting information; and taking the sum of the first UTC and the target duration as the second UTC.

[0016] In combination with the second aspect, in certain embodiments of the second aspect, the electronic device includes a first event control register and a first data register, and a processing module for triggering a first event, including: triggering the first event control register; the first event control register is used to take a snapshot of the target timer, obtain first counting information of the target timer, and save the first counting information to the first data register.

[0017] In combination with the second aspect, in certain embodiments of the second aspect, the electronic device includes a second data register and a third data register, the second data register is used to store second counting information of the target timer at the first moment, the third data register is used to store the first UTC at the first moment, and the acquisition module is used to acquire the first information, including: acquiring the second counting information from the second data register; acquiring the first UTC from the third data register.

[0018] In combination with the second aspect, in certain embodiments of the second aspect, the processing module is further used to: trigger a second event and a third event in response to a second interrupt at the first moment; a second interrupt is generated after the electronic device outputs a PPS signal, the second event is used to save the second counting information of the target timer at the first moment to the second data register, and the third event is used to save the first UTC at the first moment to the third data register.

[0019] In combination with the second aspect, in certain embodiments of the second aspect, the electronic device includes a second event control register, the second data register includes a counting information storage area, the counting information storage area is used to store the counting information of the target timer, and the processing module is also used to trigger a second event, including: triggering the second event control register; the second event control register is used to take a snapshot of the target timer, obtain the second counting information of the target timer, clear the data in the counting information storage area of ​​the second data register, and save the second counting information to the counting information storage area of ​​the second data register.

[0020] In combination with the second aspect, in certain embodiments of the second aspect, the electronic device includes a third event control register, the third data register includes a UTC storage area, the UTC storage area is used to store UTC, and the processing module is also used to trigger a third event, including: triggering the third event control register; the third event control register is used to obtain the first UTC, clear the data in the UTC storage area of ​​the third data register, and save the first UTC to the UTC storage area of ​​the third data register.

[0021] According to a third aspect, an electronic device is provided, comprising: at least one processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute instructions to implement the method provided in the first aspect and any possible implementation manner thereof.

[0022] In a fourth aspect, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method provided in the first aspect and any possible implementation manner thereof.

[0023] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method provided in the first aspect and any possible implementation manner thereof.

[0024] Among them, the technical effects brought about by any implementation of the second to fifth aspects can refer to the technical effects brought about by different implementations of the first aspect mentioned above, and will not be repeated here.

[0025] Based on the time alignment method provided by the present application, after a measuring device connected to an electronic device obtains a target power consumption value of the electronic device and generates a first interrupt, the electronic device triggers a first event for obtaining first counting information of a target timer in the electronic device when the first interrupt is generated by responding to the first interrupt, and then obtains first information including second counting information of the target timer at the first moment and first UTC at the first moment. Since the first information at the first moment is before the moment when the first interrupt is generated, the second UTC corresponding to the moment when the measuring device obtains the target power consumption value can be determined based on the first counting information, the second counting information and the first UTC, so that the power consumption value of the measured electronic device can be aligned with the moment. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of the architecture of a time alignment system provided for this application;

[0027] Figure 2 A flowchart of a time alignment method provided for this application;

[0028] Figure 3 A schematic diagram of the structure of an electronic device provided in this application;

[0029] Figure 4 A schematic diagram of the structure of another electronic device provided in this application. DETAILED DESCRIPTION

[0030] In the description of this application, unless otherwise specified, "plurality" means two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural 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.

[0031] In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

[0032] Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0033] It is understood that the "embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It is understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and 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 embodiment of the present application.

[0034] It can be understood that in the present application, "when", "if" and "if" all mean that corresponding processing will be carried out under certain objective circumstances, but do not limit the time, nor do they require judgment actions when implementing them, nor do they mean the existence of other limitations.

[0035] It can be understood that some optional features in the embodiments of the present application may be implemented independently in certain scenarios without relying on other features, such as the solution on which they are currently based, to solve corresponding technical problems and achieve corresponding effects, or may be combined with other features according to needs in certain scenarios. Accordingly, the devices provided in the embodiments of the present application may also realize these features or functions accordingly, which will not be elaborated here.

[0036] In this application, unless otherwise specified, the same or similar parts between the various embodiments can refer to each other. In the various embodiments in this application, and the various implementation methods in each embodiment, if there is no special description and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The following implementation methods of this application do not constitute a limitation on the scope of protection of this application.

[0037] Electronic devices generate power consumption when they are running. For example, the positioning chip of a satellite signal receiver has multiple operating conditions when it is running (for example, capturing satellite signals, tracking satellite signals, positioning, sleep, wake-up, ephemeris injection, RTK solution, RD combined inertial navigation, etc.). Under different operating conditions, the power consumption of the positioning chip will also be different.

[0038] The existing solution has the problem that the measured power consumption value of the electronic device is not aligned with the time. For example, the power consumption value of the electronic device is measured to be 5W at 10:00:00 on January 1, 2024. 5W should be corresponded to 10:00:00 on January 1, 2024. In some cases, 5W will be corresponded to 10:00:01 on January 1, 2024, resulting in the power consumption value of the measured electronic device not being aligned with the time.

[0039] To solve the above problems, the present application provides a time alignment method, which can be applied to a time alignment system. Figure 1 This is a schematic diagram of the architecture of a time alignment system provided by the present application. The technical solution of the embodiment of the present application can be applied to Figure 1 The time alignment system shown, such as Figure 1 As shown, the time alignment system 10 includes a measuring device 11 and an electronic device 12 .

[0040] The measuring device 11 is used to measure the power consumption value of the electronic device, and the measuring device 11 may be a power consumption measurement chip.

[0041] The electronic device 12 may include a timer, a plurality of event control registers and a plurality of data registers. The timer may count, the event control register may execute a preset processing logic after being triggered, and the data register may store data.

[0042] The electronic device 12 may be a GNSS positioning chip, or the electronic device 12 may be a receiver including a GNSS positioning chip. Of course, the electronic device 12 may also be other devices, and this application does not impose any specific limitation on this.

[0043] The measuring device 11 is directly or indirectly connected to the electronic device 12 . In this connection relationship, a wired connection or a wireless connection may be adopted, which is not limited in the embodiment of the present application.

[0044] The measuring device 11 and the electronic device 12 can exchange data.

[0045] It should be noted that the measuring device 11 and the electronic device 12 may be independent devices or integrated into the same device, and this application does not make any specific limitation on this.

[0046] When the measuring device 11 and the electronic device 12 are integrated into the same device, the communication between the measuring device 11 and the electronic device 12 is the communication between the internal modules of the device. In this case, the communication process between the two is the same as "the communication process between the two when the measuring device 11 and the electronic device 12 are independent of each other".

[0047] In the following embodiments provided in the present application, the present application is described by taking the example that the measuring device 11 and the electronic device 12 are independently configured.

[0048] In practical applications, the time alignment method provided in the embodiment of the present application can be applied to the electronic device 12, and can also be applied to the device included in the electronic device 12.

[0049] The time alignment method provided in the embodiment of the present application is described below with reference to the accompanying drawings, taking the time alignment method applied to the electronic device 12 as an example.

[0050] Figure 2 A schematic diagram of a time alignment method provided in this application, which is applied to Figure 1 The electronic device shown includes a target timer, such as Figure 2 As shown, the method comprises the following steps:

[0051] S201: The electronic device triggers a first event in response to a first interrupt.

[0052] The measuring device generates a first interrupt after obtaining the target power consumption value of the electronic device, and the first event is used to obtain first counting information of the target timer when the first interrupt is generated.

[0053] It should be noted that the target timer can run in free counting mode, which means that the target timer starts from the maximum value 0xFFFFFFFF, and automatically decreases by one after receiving a pulse from the clock source until it automatically returns to the maximum value and continues to run after decreasing to 0. The clock source of the target timer can be the external TCXO of the electronic device, with an accuracy of 1ppm, that is, there will be a maximum error of 1us per second.

[0054] Exemplarily, the first counting information may be 0x9495843, 0x9495833, or 0x9495863. Of course, the first counting information may be other values, and the present application does not impose any specific limitation on this.

[0055] As a possible implementation manner, the electronic device includes a first event control register and a first data register. After receiving the first interrupt, the electronic device triggers the first event control register in response to the first interrupt.

[0056] The first event control register is used to take a snapshot of the target timer, obtain first counting information of the target timer, and save the first counting information to the first data register.

[0057] Based on this possible implementation method, compared with triggering the first event by software, the first event is triggered by triggering the first event control register. Since the event control register is triggered at the hardware level, the hardware processing speed is faster. After the first interrupt is generated, the target timer can be snapshotted quickly to obtain the first counting information, thereby improving the accuracy of the first counting information.

[0058] S202: The electronic device obtains first information.

[0059] The first information includes the second counting information of the target timer at the first moment and the first UTC at the first moment, and the first moment is before the generation moment of the first interrupt.

[0060] Exemplarily, the second counting information may be 0x9496843, 0x9595833, or 0x9695863. Of course, the second counting information may be other values, and the present application does not impose any specific limitation on this.

[0061] As a possible implementation manner, the electronic device obtains the first information input by the external device from its own input device.

[0062] As another possible implementation, the electronic device includes a second data register and a third data register, the second data register is used to store the second counting information of the target timer at the first moment, and the third data register is used to store the first UTC at the first moment.

[0063] The electronic device obtains the second counting information from the second data register and obtains the first UTC from the third data register.

[0064] S203: The electronic device determines a second UTC according to the first counting information, the second counting information, and the first UTC.

[0065] The second UTC is the time when the measuring device obtains the target power consumption value.

[0066] As a possible implementation manner, the electronic device determines a target duration, and uses the sum of the first UTC and the target duration as the second UTC.

[0067] The target duration is the product of the target difference and the clock source frequency of the target timer, and the target difference is the difference between the first counting information and the second counting information.

[0068] In this possible implementation, since the first UTC corresponds to the second counting information, after determining the product of the target difference and the clock source frequency of the target timer, that is, the target duration, the sum of the first UTC and the target duration can be used as the second UTC.

[0069] Based on S201-S203, after the measuring device connected to the electronic device obtains the target power consumption value of the electronic device and generates a first interrupt, the electronic device triggers a first event for obtaining first counting information of the target timer in the electronic device when the first interrupt is generated by responding to the first interrupt, and then obtains first information including second counting information of the target timer at the first moment and first UTC at the first moment. Since the first information at the first moment is before the moment when the first interrupt is generated, the second UTC corresponding to the moment when the measuring device obtains the target power consumption value can be determined based on the first counting information, the second counting information and the first UTC, so that the power consumption value of the measured electronic device can be aligned with the moment.

[0070] The above is a general description of the time alignment method provided in the present application. The time alignment method provided in the present application will be further described below in conjunction with the accompanying drawings.

[0071] In one design, the time alignment method provided by the present application may further include the following steps:

[0072] S301: The electronic device triggers a second event and a third event in response to a second interrupt at a first moment.

[0073] Among them, the electronic device generates a second interrupt after outputting the PPS signal, the second event is used to save the second counting information of the target timer at the first moment to the second data register, and the third event is used to save the first UTC at the first moment to the third data register.

[0074] It should be noted that the frequency of the PPS signal can be 1 Hz-10 Hz, and this application does not impose any specific limitation on this.

[0075] The error of the PPS signal can be less than 50ns.

[0076] As a possible implementation, for the second event, the electronic device includes a second event control register, the second data register includes a counting information storage area, the counting information storage area is used to store the counting information of the target timer, and the electronic device triggers the second event control register in response to the second interrupt at the first moment.

[0077] The second event control register is used to take a snapshot of the target timer, obtain the second counting information of the target timer, clear the data in the counting information storage area of ​​the second data register, and save the second counting information to the counting information storage area of ​​the second data register.

[0078] Based on this, on the one hand, compared with triggering the second event by software, triggering the second event control register to trigger the second event, because the event control register is triggered at the hardware level, the hardware processing speed is faster, and after the second interrupt is generated, the target timer can be snapshotted quickly to obtain the second counting information, thereby improving the accuracy of the second counting information. On the other hand, before the second counting information is saved to the counting information storage area of ​​the second data register, the data in the counting information storage area of ​​the second data register is cleared, and the data stored in the counting information storage area of ​​the second data register can be updated, thereby reducing the difference between the first counting information and the second counting information, and reducing the error of the second UTC.

[0079] For the third event, the electronic device includes a third event control register, the third data register includes a UTC storage area, the UTC storage area is used to store UTC, and the electronic device triggers the third event control register.

[0080] The third event control register is used to obtain the first UTC, clear the data in the UTC storage area of ​​the third data register, and save the first UTC to the UTC storage area of ​​the third data register.

[0081] Based on this, compared to triggering the third event by software, the third event is triggered by triggering the third event control register. Since the event control register is triggered at the hardware level, the hardware processing speed is faster. After the second interrupt occurs, the first UTC can be stored in the UTC storage area of ​​the third data register more quickly.

[0082] It should be noted that the electronic device can execute S301 and S201 - S203 in parallel.

[0083] In one design, after the electronic device obtains multiple second UTCs, it can generate multiple data packets, each of which includes multiple second information, and the second information includes the second UTC, the power consumption value corresponding to the second UTC, the voltage value corresponding to the power consumption value, the current value corresponding to the power consumption value, the data packet header, the data packet check code and other information.

[0084] It should be noted that the data volume of the data packet can be 15 bytes to 25 bytes.

[0085] The second UTCs in the plurality of second information in the data packet are adjacent, so that the temporal continuity of the data in the data packet can be improved.

[0086] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the electronic device executing the time alignment method. In order to achieve the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0087] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic, which is only a logical function division, and there may be other division methods in actual implementation. In addition, the "module" here may refer to a specific application-specific integrated circuit (ASIC), a circuit, a processor and memory that executes one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions.

[0088] In the case of functional module division, Figure 3 FIG. 1 shows a schematic diagram of the structure of an electronic device. Figure 3 As shown, the electronic device 30 includes an acquisition module 301 and a processing module 302 .

[0089] In some embodiments, the electronic device 30 may further include a storage module ( Figure 3 ), for storing program instructions and data.

[0090] Among them, the processing module 302 is used to trigger the first event in response to the first interrupt; the measuring device generates a first interrupt after obtaining the target power consumption value of the electronic device, and the first event is used to obtain the first counting information of the target timer when the first interrupt is generated; the acquisition module 301 is used to obtain the first information; the first information includes the second counting information of the target timer at the first moment and the first UTC of the first moment, and the first moment is before the moment when the first interrupt is generated; the processing module 302 is also used to determine the second UTC based on the first counting information, the second counting information and the first UTC; the second UTC is the moment when the measuring device obtains the target power consumption value.

[0091] Optionally, the processing module 302 is also used to determine the second UTC based on the first counting information, the second counting information and the first UTC, including: determining a target duration; the target duration is the product of a target difference and a clock source frequency of a target timer, and the target difference is the difference between the first counting information and the second counting information; and taking the sum of the first UTC and the target duration as the second UTC.

[0092] Optionally, the electronic device includes a first event control register and a first data register, and the processing module 302 is used to trigger the first event, including: triggering the first event control register; the first event control register is used to take a snapshot of the target timer, obtain the first counting information of the target timer, and save the first counting information to the first data register.

[0093] Optionally, the electronic device includes a second data register and a third data register, the second data register is used to store the second counting information of the target timer at the first moment, and the third data register is used to store the first UTC at the first moment, and the acquisition module 301 is used to obtain the first information, including: obtaining the second counting information from the second data register; obtaining the first UTC from the third data register.

[0094] Optionally, the processing module 302 is also used to: trigger a second event and a third event in response to a second interrupt at the first moment; generate a second interrupt after the electronic device outputs a PPS signal, the second event is used to save the second counting information of the target timer at the first moment to the second data register, and the third event is used to save the first UTC at the first moment to the third data register.

[0095] Optionally, the electronic device includes a second event control register, the second data register includes a counting information storage area, the counting information storage area is used to store the counting information of the target timer, and the processing module 302 is also used to trigger a second event, including: triggering the second event control register; the second event control register is used to take a snapshot of the target timer, obtain the second counting information of the target timer, clear the data in the counting information storage area of ​​the second data register, and save the second counting information to the counting information storage area of ​​the second data register.

[0096] Optionally, the electronic device includes a third event control register, the third data register includes a UTC storage area, the UTC storage area is used to store UTC, and the processing module 302 is also used to trigger a third event, including: triggering the third event control register; the third event control register is used to obtain the first UTC, clear the data in the UTC storage area of ​​the third data register, and save the first UTC to the UTC storage area of ​​the third data register.

[0097] All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0098] When the functions of the above functional modules are implemented in the form of hardware, Figure 4 FIG. 2 shows a schematic diagram of the structure of another electronic device. Figure 4 As shown, the electronic device 40 includes a processor 401, a memory 402 and a bus 403. The processor 401 and the memory 402 may be connected via the bus 403.

[0099] The processor 401 is the control center of the electronic device 40, and can be a processor or a general term for multiple processing elements. For example, the processor 401 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.

[0100] As an embodiment, the processor 401 may include one or more CPUs, such as Figure 4 CPU 0 and CPU 1 are shown in .

[0101] The memory 402 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0102] As a possible implementation, the memory 402 may exist independently of the processor 401, and the memory 402 may be connected to the processor 401 via a bus 403 to store instructions or program codes. When the processor 401 calls and executes the instructions or program codes stored in the memory 402, the time alignment method provided in the embodiment of the present application can be implemented.

[0103] In another possible implementation, the memory 402 may also be integrated with the processor 401 .

[0104] The bus 403 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0105] It should be pointed out that Figure 4 The structure shown does not constitute a limitation on the electronic device 40. Figure 4 In addition to the components shown, the electronic device 40 may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0106] As an example, combining Figure 3 The functions implemented by the acquisition module 301 and the processing module 302 in the electronic device 30 are similar to those Figure 4 The function of processor 401 in is the same.

[0107] Optional, such as Figure 4 As shown, the electronic device 40 provided in the embodiment of the present application may further include a communication interface 403 .

[0108] The communication interface 403 is used to connect with other devices via a communication network. The communication network may be Ethernet, wireless access network, wireless local area network (WLAN), etc. The communication interface 403 may include a receiving unit for receiving data and a sending unit for sending data.

[0109] In a possible implementation, in the electronic device 40 provided in the embodiment of the present application, the communication interface 403 may also be integrated in the processor 401, which is not specifically limited in the embodiment of the present application.

[0110] As a possible product form, the electronic device of the embodiment of the present application can also be implemented using the following: one or more field programmable gate arrays (FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits capable of performing the various functions described throughout the present application.

[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units is used as an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0112] An embodiment of the present application also provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed, the computer executes each step in the method flow shown in the above method embodiment.

[0113] An embodiment of the present application provides a computer program product including instructions. When the instructions are executed on a computer, the computer is caused to execute each step in the method flow shown in the above method embodiment.

[0114] An embodiment of the present application provides a chip system, including: a processor and an interface circuit; the interface circuit is used to receive a computer program or instruction and transmit it to the processor; the processor is used to execute the computer program or instruction so that the chip system executes each step in the method flow shown in the above method embodiment.

[0115] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, and a hard disk. Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM), registers, hard disks, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any other form of computer-readable storage media in a suitable combination of the above, or numerical values ​​in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in a specific-purpose ASIC. In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0116] Since the electronic device, computer-readable storage medium, and computer program product provided in this embodiment can be applied to the time alignment method provided by this embodiment, the technical effects that can be obtained can also refer to the above-mentioned method embodiments, and the embodiments of this application will not be repeated here.

[0117] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0118] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A time alignment method, characterized in that: The method is applied to an electronic device, the electronic device is connected to a measuring device, the measuring device is used to measure the power consumption value of the electronic device, the electronic device includes a target timer, and the method includes: In response to the first interrupt, a first event is triggered; the measuring device generates the first interrupt after obtaining the target power consumption value of the electronic device, and the first event is used to obtain the first counting information of the target timer when the first interrupt is generated; Acquire first information; the first information includes the second counting information of the target timer at a first moment and the first UTC of the first moment, the first moment being before the moment when the first interrupt is generated; A second UTC is determined according to the first counting information, the second counting information and the first UTC; the second UTC is the moment when the measuring device obtains the target power consumption value.

2. The method according to claim 1, characterized in that The determining the second UTC according to the first counting information, the second counting information and the first UTC includes: Determine a target duration; the target duration is the product of a target difference and a clock source frequency of the target timer, and the target difference is the difference between the first counting information and the second counting information; The sum of the first UTC and the target duration is taken as the second UTC.

3. The method according to claim 1, characterized in that The electronic device comprises a first event control register and a first data register, and the triggering of the first event comprises: Trigger the first event control register; the first event control register is used to take a snapshot of the target timer, obtain the first counting information of the target timer, and save the first counting information to the first data register.

4. The method according to any one of claims 1 to 3, characterized in that: The electronic device includes a second data register and a third data register, the second data register is used to store the second counting information of the target timer at the first moment, and the third data register is used to store the first UTC of the first moment, and the acquiring the first information includes: Acquire the second counting information from the second data register; The first UTC is obtained from the third data register.

5. The method according to claim 4, characterized in that The method further comprises: In response to the second interrupt at the first moment, a second event and a third event are triggered; the second interrupt is generated after the electronic device outputs the PPS signal, the second event is used to save the second counting information of the target timer at the first moment to the second data register, and the third event is used to save the first UTC of the first moment to the third data register.

6. The method according to claim 5, characterized in that The electronic device includes a second event control register, the second data register includes a counting information storage area, the counting information storage area is used to store the counting information of the target timer, and triggering the second event includes: Trigger the second event control register; the second event control register is used to take a snapshot of the target timer, obtain the second counting information of the target timer, clear the data in the counting information storage area of ​​the second data register, and save the second counting information to the counting information storage area of ​​the second data register.

7. The method according to claim 5, characterized in that The electronic device includes a third event control register, the third data register includes a UTC storage area, the UTC storage area is used to store UTC, and triggering the third event includes: The third event control register is triggered; the third event control register is used to obtain the first UTC, clear the data in the UTC storage area of ​​the third data register, and save the first UTC to the UTC storage area of ​​the third data register.

8. An electronic device, characterized in that: The electronic device is connected to a measuring device, the measuring device is used to measure the power consumption value of the electronic device, the electronic device includes a target timer, and the electronic device includes: an acquisition module and a processing module; The processing module is used to trigger a first event in response to a first interrupt; the measuring device generates the first interrupt after obtaining the target power consumption value of the electronic device, and the first event is used to obtain the first counting information of the target timer when the first interrupt is generated; The acquisition module is used to acquire first information; the first information includes the second counting information of the target timer at a first moment and the first UTC of the first moment, and the first moment is before the moment when the first interrupt is generated; The processing module is further used to determine a second UTC according to the first counting information, the second counting information and the first UTC; the second UTC is the moment when the measuring device obtains the target power consumption value.

9. An electronic device, characterized in that: The electronic device comprises: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the device executes the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instructions are executed, the computer is caused to perform the method according to any one of claims 1 to 8.