Time synchronization method and electronic device

By obtaining the status information of the electronic device to calculate the time difference and using the synchronization database for time synchronization, the problem of time deviation caused by different chip timing methods is solved, and the collaborative work efficiency and data consistency of the electronic device are improved.

CN118244843BActive Publication Date: 2024-10-15HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410678952.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-10-15
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

In electronic equipment, since different chips use different timing methods, the time information of the first chip and the second chip at the same moment may be biased, affecting work efficiency and data consistency in collaborative work scenarios.

Method used

By obtaining the status information of the electronic device, such as temperature information and load information, the time difference is calculated, and the synchronization database is used for time synchronization, and the timing results of the chip are adjusted to achieve time consistency.

Benefits of technology

It effectively solves the problem of chip time deviation, improves the data consistency and response efficiency of electronic devices in collaborative work scenarios, and reduces communication delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118244843B_ABST
    Figure CN118244843B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a time synchronization method and an electronic device, which relates to the technical field of electronic devices. Time synchronization between a first chip and a second chip can be achieved. The method is applied to a first chip, which is arranged in an electronic device. The first chip and the second chip are connected in communication. The first chip and the second chip are used to collaboratively process a first business. The method includes: obtaining first state information. The first state information includes at least one of the following: first temperature information of the electronic device, first load information, and a first identity. According to the first state information, a first time difference is obtained. The first time difference is used to indicate the time difference between the first time information and the second time information, and the first time information is the timing result of the first chip at the first moment. The second time information is the timing result of the second chip at the first moment. According to the first time difference, the timing results of the first chip and the second chip are time synchronized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of electronic devices, and in particular to a time synchronization method and electronic device. Background Art

[0002] At present, multiple chips can be configured in an electronic device. The multiple chips can be connected through communication lines to facilitate the subsequent transmission of information such as data and signals. The multiple chips can work together to complete the processing of related services in the electronic device.

[0003] Exemplarily, the plurality of chips in the electronic device may include a first chip, wherein the first chip and the second chip are connected via a communication line. In some implementations, the electronic device may further include a second chip.

[0004] Different chips may use different timing methods. Thus, the time information corresponding to the first chip and the second chip at the same time may be different.

[0005] Some working scenarios have high requirements for time synchronization of different chips. For example, the working scenario may include collaborative working and other scenarios. Therefore, the deviated time information will affect the work of the first chip and the second chip in the working scenario. Summary of the invention

[0006] The embodiments of the present application provide a time synchronization method and an electronic device for implementing time synchronization between a first chip and a second chip.

[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0008] In a first aspect, a time synchronization method is provided, which is applied to a first chip, and the first chip is set in an electronic device. The first chip is in communication connection with the second chip. The first chip and the second chip are used to collaboratively process a first business. The method includes: after the electronic device is turned on, first state information is obtained. The first state information includes at least one of the following: first temperature information, first load information and first identity identification of the electronic device. According to the first state information, a first time difference is obtained. The first time difference is used to indicate the time difference between the first time information and the second time information, and the first time information is the timing result of the first chip at the first moment. The second time information is the timing result of the second chip at the first moment. According to the first time difference, the timing results of the first chip and the second chip are synchronized.

[0009] Based on the above solution, the first chip can determine the first time difference with the second chip at the first moment according to the first temperature information, the first load information and the first identity corresponding to the electronic device. Thus, the first chip and the second chip can be synchronized according to the first time difference.

[0010] Optionally, the time synchronization of the timing results of the first chip and the second chip according to the first time difference includes: the first chip adjusts the first time information according to the first time difference so that the first time information is synchronized with the second time information. Furthermore, the time synchronization of the first chip and the second chip is achieved by adjusting the first time information by the first chip.

[0011] Optionally, the time synchronization of the timing results of the first chip and the second chip according to the first time difference includes: the first chip sends the first time difference to the second chip, so that the second chip adjusts the second time information according to the first time difference. Furthermore, the time synchronization of the first chip and the second chip is achieved by adjusting the second time information by the second chip.

[0012] Optionally, the electronic device is also configured with the second chip.

[0013] Optionally, obtaining the first time difference value according to the first state information includes: determining first function information according to the first state information. The first function information is used to indicate the correspondence between at least one fourth moment and a fourth time difference value under the first state information. The fourth time difference value is the time difference between the timing result of the first chip at the fourth moment and the timing result of the second chip at the fourth moment. Determine the first time difference value according to the first function information. Based on the above scheme, the first chip can determine the first function information corresponding to the first state information according to the first state information. Then, the first chip can obtain the first time difference value according to the first state information. Thus, the first chip can achieve the acquisition of the first time difference value.

[0014] Optionally, a synchronization database is stored in the electronic device. The synchronization database includes at least one second function information and second state information corresponding to the second function information. The second function information is used to indicate the correspondence between at least one fifth moment and a fifth time difference under the second state information. The fifth time difference is the time difference between the timing result of the first chip at the fifth moment and the timing result of the second chip at the fifth moment. The second state information includes at least one of the following: second temperature information, second load information and the first identity of the electronic device. The obtaining of the first function information according to the first state information includes: obtaining the first function information from the synchronization database according to the first state information.

[0015] Based on the above solution, the first chip can obtain the first function information from the synchronization database stored in the electronic device, so as to facilitate the subsequent use of the first function information by the first chip.

[0016] Optionally, before acquiring the first function information according to the first state information, the method further includes: configuring the synchronization database according to the first state information.

[0017] Optionally, before configuring the synchronization database, the method further includes: obtaining third time information, fourth time information, fifth time information and sixth time information under the first state information. The third time information is the timing result of the first chip at the second moment. The fourth time information is the timing result of the second chip at the second moment. The fifth time information is the timing result of the first chip at the third moment. The sixth time information is the timing result of the second chip at the third moment. Determine the second time difference and the third time difference. The second time difference is the time difference between the third time information and the fourth time information. The third time difference is the time difference between the fifth time information and the sixth time information. Thus, the first chip can obtain the time difference with the timing result of the second chip at the second moment, and the time difference with the timing result of the second chip at the third moment.

[0018] Optionally, the configuration synchronization database includes: determining the first function information according to the second moment, the second time difference, and the third moment, the third time difference. The first function information and the first state information are included in the synchronization database. Thus, the first chip can subsequently obtain the first function information corresponding to the first state information from the synchronization database.

[0019] Optionally, before acquiring the third time information, the fourth time information, the fifth time information, and the sixth time information, the method further includes: at the second moment, the first chip receives a first interrupt signal. At the third moment, the first chip receives a second interrupt signal. The first interrupt signal and the second interrupt signal are sent by the second chip. In this way, it is convenient to subsequently acquire the time information corresponding to the first chip and the second chip at the second moment, and the time information corresponding to the first chip and the second chip at the third moment.

[0020] Optionally, the third time information is a timing result when the first chip receives the first interrupt signal. The fourth time information is a timing result when the second chip sends the first interrupt signal. The fifth time information is a timing result when the first chip receives the second interrupt signal. The sixth time information is a timing result when the second chip sends the second interrupt signal.

[0021] Optionally, configuring the synchronization database includes: configuring the synchronization database when the first function information corresponding to the first state information is not retrieved from the synchronization database, so that the first chip can subsequently obtain the first function information corresponding to the first state information from the synchronization database.

[0022] Optionally, configuring the synchronization database includes: configuring the synchronization database within a preset time according to a preset cycle after the electronic device is turned on. Thus, the time for the first chip to obtain the first function information corresponding to the first state information can be reduced, and the efficiency of time synchronization between the first chip and the second chip can be improved.

[0023] Optionally, after the electronic device is powered on, obtaining the first state information includes: obtaining the first state information when the first chip and the second chip collaboratively process the first service. Or, obtaining the first state information when the electronic device switches from a sleep state to a wake-up state.

[0024] Optionally, the first service requires time synchronization between the first chip and the second chip.

[0025] Optionally, the first chip includes a microcontroller unit MCU. The second chip includes an application processor AP.

[0026] In a second aspect, an electronic device includes: a memory and one or more processors. The memory is coupled to the processor. The electronic device also includes a first chip. The first chip is communicatively connected to the second chip, and the first chip and the second chip are used to collaboratively process a first service. The memory is used to store a computer program code, and the computer program code includes a computer instruction. When the processor executes the computer instruction, the electronic device executes the time synchronization method provided in the first aspect and any possible design thereof.

[0027] Optionally, the electronic device also includes the second chip.

[0028] In a third aspect, a chip system includes a processor and a communication interface. The chip system includes a first chip. The first chip is communicatively connected to a second chip, and the first chip and the second chip are used to collaboratively process a first service.

[0029] The processor is used to call and run a computer program stored in a storage medium from a storage medium to execute a time synchronization method as provided in the first aspect and any possible design thereof.

[0030] In a fourth aspect, a computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the time synchronization method provided in the first aspect and any possible design thereof.

[0031] In a fifth aspect, a computer program product comprises computer instructions, which, when executed by a processor, implement the time synchronization method provided in the first aspect and any possible design thereof.

[0032] It can be understood that the technical solutions provided in the second to fifth aspects above can respectively correspond to the time synchronization methods provided in the aforementioned designs, and the beneficial effects that can be obtained are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of the structure of an electronic device;

[0034] Figure 2 A schematic diagram of time information corresponding to the first chip and the second chip;

[0035] Figure 3 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application;

[0036] Figure 4 A schematic diagram of an interactive process of a time synchronization method provided in an embodiment of the present application;

[0037] Figure 5 A corresponding relationship diagram between different moments and time differences provided in an embodiment of the present application;

[0038] Figure 6 A schematic diagram of an interaction process of another time synchronization method provided in an embodiment of the present application;

[0039] Figure 7 A schematic diagram of an interaction process of another time synchronization method provided in an embodiment of the present application;

[0040] Figure 8 A schematic diagram of another electronic device provided in an embodiment of the present application;

[0041] Fig. 9 A schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0043] At present, multiple chips can be configured in an electronic device. The multiple chips can be connected through communication lines to facilitate the subsequent transmission of information such as data and signals. The multiple chips can work together to complete the processing of related services in the electronic device.

[0044] Exemplary, reference Figure 1 , the plurality of chips in the electronic device may include a first chip, wherein the first chip and the second chip are connected via a communication line.

[0045] In some implementations, such as Figure 1 As shown, the electronic device may further include a second chip.

[0046] In some other implementations, the first chip and the second chip may be configured in two different electronic devices.

[0047] In the embodiment of the present application, the first chip and the second chip use different timing methods to obtain time information. The time information corresponds to a timing result at a moment.

[0048] Since different timing methods have different timing precisions, the time information corresponding to the first chip and the second chip at the same time may deviate.

[0049] As an example, refer to Figure 2 , taking the example that the time information corresponding to the first chip is located on time axis 1, and the time information corresponding to the second chip is located on time axis 2, Figure 2 The time information corresponding to the first chip and the second chip at multiple same moments is shown.

[0050] Take the multiple same moments including moment 1, moment 2 and moment 3 as an example. Figure 2 As shown, at time 1, the time information of the first chip and the second chip are both T0. At time 2, the time information of the first chip is T1, and the time information of the second chip is T3, and the time information T1 and the time information T3 are different. At time 3, the time information of the first chip is T2, and the time information of the second chip is T4, and the time information T2 and the time information T4 are different.

[0051] In the first chip, the time information T0 and the time information T1 differ by a time interval Δa1, and the time information T1 and the time information T2 differ by a time interval Δa2. In the second chip, the time information T0 and the time information T3 differ by a time interval Δb1, and the time information T3 and the time information T4 differ by a time interval Δb2.

[0052] In this example, the time interval Δa1 is different from the time interval Δb1. The time interval Δa2 is also different from the time interval Δb2.

[0053] For example, if the time interval Δa1 is smaller than the time interval Δb1, then the time interval Δa2 is also smaller than the time interval Δb2.

[0054] For another example, if the time interval Δa1 is greater than the time interval Δb1, then the time interval Δa2 is also greater than the time interval Δb2.

[0055] Thus, the time difference between the first chip and the second chip at time 2 is the difference between the time interval Δa1 and the time interval Δb1. The time difference between the first chip and the second chip at time 3 is the difference between the time interval Δa1 and the time interval Δb1 plus the difference between the time interval Δa2 and the time interval Δb2.

[0056] By analogy, it can be concluded that the longer the first chip and the second chip work, the greater the time deviation between the first chip and the second chip at the same time.

[0057] Therefore, at different times, the deviations of the time information corresponding to the first chip and the second chip are also different.

[0058] In addition, the time difference between time 1 and time 2 is the same as the time difference between time 2 and time 3. In some implementations, since the timing accuracy of the first chip and the second chip varies with time, the time interval Δa1 is different from the time interval Δa2, and the time interval Δb1 is also different from the time interval Δb2.

[0059] Some working scenarios have high requirements for time synchronization of different chips. For example, the working scenario may include collaborative working and other scenarios. Therefore, the deviated time information will affect the work of the first chip and the second chip in the working scenario.

[0060] For example, due to the deviation of the time information of the first chip and the second chip, the data consistency between the first chip and the second chip is poor, which in turn causes the electronic device to take a long time to respond to user operations, reduce data processing efficiency, and increase communication delays.

[0061] To solve the above problems, an embodiment of the present application provides a time synchronization method and an electronic device. Based on the method, a synchronization database is stored in the electronic device. The synchronization database includes at least one function information 1 and state information 2 corresponding to the function information 1. Among them, the function information 1 is used to indicate the correspondence between at least one moment 4 and the time difference A under the state information 2. The time difference A is the time difference between the timing results corresponding to the first chip and the second chip at the moment 4. The state information 2 may include at least one of the electronic device's identity identification_1, temperature information_1 and load information_1. The electronic device can determine the time difference corresponding to the first chip and the second chip at the target moment based on the synchronization database and the real-time state information of the electronic device. The time deviation value can be used to achieve time synchronization between the first chip and the second chip.

[0062] In other embodiments of the present application, function information 1 may also be referred to as second function information. State information 2 may also be referred to as second state information. Moment 4 may also be referred to as a fifth moment. Time difference A may also be referred to as a fifth time difference. Identity identifier_1 may also be referred to as a first identity identifier, temperature information_1 may also be referred to as second temperature information, and load information_1 may also be referred to as second load information.

[0063] The technical solution provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0064] It should be noted that the solution provided in the embodiments of the present application can be applied to electronic devices.

[0065] The electronic device in the embodiment of the present application may include at least one of a mobile phone, a foldable electronic device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.

[0066] As an implementation, the electronic device may have Figure 3 The structure of the electronic device 300 is shown.

[0067] like Figure 3As shown, the electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) connector 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a sensor module 380, a camera module 393, a display screen 394, etc.

[0068] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 300. In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0069] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0070] The modem may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The AP outputs a sound signal through an audio device, or displays an image or video through a display screen 394. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 310 and may be set in the same device as the mobile communication module 350 or other functional modules.

[0071] The processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.

[0072] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 may be a cache memory. The memory may store instructions or data that have been used or are frequently used by the processor 310. If the processor 310 needs to use the instruction or data, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.

[0073] The internal memory 321 can be used to store computer executable program codes, which include instructions. The internal memory 321 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 300 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 310 executes various functional methods or data processing of the electronic device 300 by running instructions stored in the internal memory 321, and / or instructions stored in a memory provided in the processor.

[0074] In the embodiment of the present application, the electronic device is further configured with a microcontroller unit (MCU). The MCU can work in conjunction with the AP to process components that directly interact with the user, such as a touch screen, keyboard, battery, sensor, camera, and user interface.

[0075] For example, the MCU may include at least one of a touch screen controller, a keyboard controller, a battery management system, a sensor controller, a camera controller, a wireless communication controller, and a user interface controller.

[0076] The following uses the first chip as an MCU and the second chip as an AP as an example to describe in detail the solution provided in the embodiments of the present application.

[0077] In some embodiments of the present application, the MCU can determine the time difference Δt between the MCU and the AP at the target time based on the synchronization database and the current status information of the electronic device, so that the AP or MCU can perform time calibration based on the time difference Δt to achieve time synchronization between the MCU and the AP.

[0078] As an implementation method, before performing time synchronization processing on the MCU and the AP, the electronic device may configure a synchronization database according to the time information corresponding to the AP and the MCU at the at least two same moments and the current state information of the electronic device.

[0079] Exemplary, reference Figure 4 After the electronic device is powered on for the first time, the MCU can obtain the time information corresponding to the AP at two identical moments, as well as the status information B of the electronic device. The MCU can determine the function information A based on the time information corresponding to the AP and the MCU at two identical moments. The function information A is used to indicate the correspondence between at least one moment 5 and the time difference B under the status information B. The time difference B is the time difference between the timing results corresponding to the first chip and the second chip at the moment 5. The function information A corresponds to the status information B of the current electronic device. The MCU can store the function information A and the status information B, thereby realizing the configuration of the synchronization database.

[0080] like Figure 4 As shown, the program includes:

[0081] S401. AP sends interrupt signal 1 to MCU.

[0082] Exemplarily, after the electronic device is powered on for the first time, it can send an interrupt signal 1 to the MCU through the AP.

[0083] For example, after the electronic device is powered on for the first time, the AP may send the interrupt signal 1 to the MCU via a general purpose input output (GPIO).

[0084] In other embodiments of the present application, the interrupt signal 1 may also be referred to as a first interrupt signal.

[0085] S402. The AP records the time information t1 when the interrupt signal 1 is sent.

[0086] For example, taking the case where the AP sends the interruption signal 1 at time A, the time information t1 is the timing result of the AP at time A. When the AP sends the interruption signal number 1, the time information t1 may be recorded.

[0087] In some other embodiments of the present application, time A may also be referred to as a second time. Time information t1 may also be referred to as fourth time information.

[0088] S403 , the MCU records the time information t2 when the interrupt signal 1 is received.

[0089] It should be noted that, in the embodiment of the present application, since the interrupt signal 1 is transmitted through the GPIO, the time when the MCU receives the interrupt signal 1 is the time when the AP sends the interrupt signal 1.

[0090] Exemplarily, the time information t2 is the timing result of the MCU at time A. When the MCU receives the interrupt signal 1, the time information t2 may be recorded.

[0091] In other embodiments of the present application, the time information t2 may also be referred to as third time information.

[0092] S404. The AP sends time information t1 to the MCU.

[0093] In an embodiment of the present application, the AP may send the time information t1 recorded when sending the interrupt signal 1 to the MCU, so that the MCU may perform subsequent processing according to the time information t1.

[0094] Thus, the MCU can obtain the timing results corresponding to the AP and the MCU at time A. The time A corresponds to the time when the AP sends the interrupt signal 1 or the time when the MCU receives the interrupt signal 1.

[0095] S405 , the MCU calculates the time difference D1 between the time information t1 and the time information t2 .

[0096] For example, after receiving the time information t1, the MCU may calculate the time difference D1 between the time information t1 and the time information t2, so that the MCU can obtain the time difference between the timing result at the time A and the AP.

[0097] In other embodiments of the present application, the time difference D1 may also be referred to as a second time difference.

[0098] S406: The AP sends an interrupt signal 2 to the MCU.

[0099] In an embodiment of the present application, after sending the interrupt signal 1, the AP may continue to send the interrupt signal 2 to the MCU at a preset time interval.

[0100] For example, taking the preset time interval as 1 second, the AP may continue to send an interrupt signal 2 to the MCU after sending the interrupt signal 1 and waiting for 1 second.

[0101] In other embodiments of the present application, the interrupt signal 2 may also be referred to as a second interrupt signal.

[0102] S407. The AP records the time information t3 when the interrupt signal 2 is sent.

[0103] S408. The MCU records the time information t4 when the interrupt signal 2 is received.

[0104] Similarly, in the embodiment of the present application, the time when the AP sends the interrupt signal 2 is the time when the MCU receives the interrupt signal 2.

[0105] For example, taking the case where the AP sends the interrupt signal 2 at time B, the time information t3 is the timing result corresponding to the AP at time B. The time information t4 is the timing result corresponding to the MCU at time B.

[0106] In other embodiments of the present application, time B may also be referred to as the third time, time information t3 may also be referred to as the sixth time information, and time information t4 may also be referred to as the fifth time information.

[0107] S409: The AP sends time information t3 to the MCU.

[0108] In an embodiment of the present application, the AP may send the time information t3 recorded when sending the interrupt signal 2 to the MCU, so that the MCU may perform subsequent processing according to the time information t3.

[0109] Thus, the MCU can obtain the timing results corresponding to the AP and the MCU at time B. The time B corresponds to the time when the AP sends the interrupt signal 2 or the time when the MCU receives the interrupt signal 2.

[0110] S410 , the MCU calculates the time difference D2 between the time information t3 and the time information t4 .

[0111] For example, after receiving the time information t3, the MCU may calculate the time difference D2 between the time information t3 and the time information t4, so that the MCU can obtain the time difference between the timing result at the time B and the AP.

[0112] In other embodiments of the present application, the time difference D2 may also be referred to as a third time difference.

[0113] S411. MCU obtains function information A according to time information t2 and time difference D1, and time information t4 and time difference D2.

[0114] Exemplarily, the function information A may include parameter 1 and parameter 2. Parameter 1 and parameter 2 are used to indicate straight line A. Straight line A is a straight line where (time information t2, time difference D1) and (time information t4, time difference D2) are located.

[0115] For example, Figure 5As shown, the two points (time information t2, time difference D1) and (time information t4, time difference D2) are located on the straight line A. The parameter 1 may be the slope value k1 of the straight line A, and the parameter 2 may be the vertical intercept value b1 of the straight line A.

[0116] That is, the time difference D1 = time information t2 * slope value k1 + vertical intercept value b1. Similarly, the time difference D2 = time information t4 * slope value k1 + vertical intercept value b1.

[0117] For another example, the parameter 1 may be the vertical intercept value b1 of the straight line A, and the parameter 2 may be the horizontal intercept value b2 of the straight line A.

[0118] In this way, the MCU can subsequently determine the time difference Δt between the MCU and the AP at the target time according to the parameter 1 and the parameter 2 in the function information A.

[0119] It should be noted that, in the description of S411, the time information t2 and the time difference D1, and the time information t4 and the time difference D2 are taken as examples to illustrate the implementation method of obtaining the function information A.

[0120] As another implementation manner, the MCU may obtain the function information A according to the time information t1 and the time difference D1, and the time information t3 and the time difference D2.

[0121] Among them, the implementation method of MCU obtaining function information A according to time information t1, time difference D1, time information t3, time difference D2 is similar to the implementation method of MCU obtaining function information A according to time information t2, time difference D1, time information t4, time difference D2. Please refer to the description in S411 and no further details will be given here.

[0122] In addition, in the embodiment of the present application, when the state information of the electronic device is different, the corresponding function information obtained is also different. Therefore, when the electronic device obtains function information A, it also needs to obtain state information B corresponding to function information A.

[0123] S412. The MCU obtains status information B corresponding to the electronic device.

[0124] Exemplarily, after receiving the interrupt signal 1, the MCU may obtain the state information B corresponding to the electronic device. The state information B may include at least one of the identity identification 1, temperature information 1 and load information 1 of the electronic device.

[0125] For example, when the MCU receives the interrupt signal 2 or obtains the function information A, it can obtain the status information B corresponding to the electronic device.

[0126] S413. The MCU stores database 1, where database 1 includes function information A and status information B.

[0127] Exemplarily, after acquiring the function information A and the state information B, the MCU may generate a database 1 and store the database 1 in the electronic device. The database 1 includes the function information A and the state information B. This allows the MCU to acquire the database 1 when it is used later.

[0128] In this example, function information A corresponds to state information B. Database 1 is included in the synchronization database.

[0129] It should be noted that in Figure 4 In the description, the specific implementation method of configuring the synchronization database is described by taking the MCU according to the time information corresponding to the AP at two same moments as an example. In other embodiments of the present application, the AP can configure the synchronization database according to the time information corresponding to the MCU at two same moments.

[0130] like Figure 6 As shown, the program includes:

[0131] S601. MCU sends an interrupt signal 3 to AP.

[0132] Exemplarily, after the electronic device is powered on for the first time, the MCU may send an interrupt signal 3 to the AP.

[0133] For example, after the electronic device is powered on for the first time, the MCU may send an interrupt signal 3 to the AP via the GPIO.

[0134] S602. The MCU records the time information t5 when the interrupt signal 3 is sent.

[0135] In this example, the time information t5 is the timing result of the MCU at the time C. The time C is the time when the MCU sends the interrupt signal 3.

[0136] S603. AP records the time information t6 when the interrupt signal 3 is received.

[0137] It should be noted that, in the embodiment of the present application, the time when the AP receives the interrupt signal 3 is the time when the MCU sends the interrupt signal 3. That is, the AP receives the interrupt signal 3 at time C.

[0138] In this example, the time information t6 is the timing result of the MCU at time C.

[0139] S604. The MCU sends time information t5 to the AP.

[0140] In an embodiment of the present application, the MCU may send the time information t5 recorded when sending the interrupt signal 3 to the AP, so that the AP may perform subsequent processing according to the time information t5.

[0141] S605. The AP calculates the time difference D3 between the time information t5 and the time information t6.

[0142] For example, after receiving the time information t5, the AP may calculate the time difference D3 between the time information t5 and the time information t6, so that the AP can obtain the time difference corresponding to the MCU at time C.

[0143] S606. The MCU sends an interrupt signal 4 to the AP.

[0144] Similarly, in an embodiment of the present application, after sending the interrupt signal 3, the MCU may continue to send the interrupt signal 4 to the AP at a preset time interval.

[0145] S607. The MCU records the time information t7 when the interrupt signal 4 is sent.

[0146] S608. AP records the time information t8 when the interrupt signal 4 is received.

[0147] For example, taking the case where the MCU sends the interrupt signal 4 at time D, the time information t7 is the timing result corresponding to the MCU at time D. The time information t8 is the timing result corresponding to the AP at time D.

[0148] S609. The MCU sends time information t7 to the AP.

[0149] S610. AP calculates the time difference D4 between time information t7 and time information t8.

[0150] Thus, the AP can obtain the time difference corresponding to the MCU at time D.

[0151] In this example, the implementation of S606 to S610 is similar to the implementation of S601 to S605, and the specific content can refer to the description of S601 to S605.

[0152] S611. AP obtains function information C according to time information t5 and time difference D3, and time information t7 and time difference D4.

[0153] In the embodiment of the present application, the function information C is similar to the function information A. The implementation manner of the AP acquiring the function information C is similar to the implementation manner of the MCU acquiring the function information A. For details, please refer to the description in S411 and will not be repeated here.

[0154] S612: The AP obtains status information D corresponding to the electronic device.

[0155] Exemplarily, after receiving the interrupt signal 3, the AP may obtain the state information D corresponding to the electronic device. The state information D is similar to the state information B in S412, and the state information D may include at least one of the identity identifier 2, temperature information 2, and load information 2 of the electronic device. The identity identifier 2 may correspond to the identity identifier 1.

[0156] For example, the AP may obtain the status information D of the electronic device when receiving the interrupt signal 4 or obtaining the function information C.

[0157] In some implementations, after acquiring the function information C and the state information D, the AP may send the function information C and the state information D to the MCU.

[0158] Correspondingly, after acquiring the function information C and the state information D, the MCU can generate a database 2. The database 2 includes the function information C and the state information D. The database 2 is included in the synchronization database.

[0159] As another implementation manner, the electronic device may enable the MCU to obtain the function information C and the state information D by executing the processes in S613 and S614.

[0160] S613: The AP generates database 2, which includes function information C and state information D.

[0161] In the embodiment of the present application, after acquiring the function information C and the state information D, the AP may generate a corresponding database 2. The database 2 includes the function information C and the state information D, and the function information C corresponds to the state information D.

[0162] In some implementations, after generating database 2, the AP may continue to perform the process in S614, so that the MCU can obtain database 2.

[0163] S614. The AP sends database 2 to the MCU.

[0164] S615. MCU stores database 2.

[0165] Exemplarily, after receiving the data 2, the MCU may store the database 2 so that the MCU can obtain the database 2 when using it later.

[0166] It should be noted that, in the description of S612, the AP obtains the state information D as an example. In other embodiments of the present application, the electronic device can obtain the current state information D of the electronic device through the MCU.

[0167] For example, after sending the interrupt signal 3, the MCU may obtain the status information D corresponding to the electronic device.

[0168] In this embodiment, after acquiring the function information C, the AP may send the function information C to the MCU. After receiving the function information C, the MCU may include the function information C and the state information D in the database 2 .

[0169] In such Figure 4 He Ru Figure 6 In the description, the implementation method of obtaining function information (such as function information A or function information C) is described based on the time information corresponding to the AP and the MCU at two identical moments. In other embodiments of the present application, the electronic device can obtain function information E based on the time information corresponding to the AP and the MCU at three or more identical moments.

[0170] The following describes the implementation method of the MCU acquiring the function information E by taking the time information corresponding to the MCU and the AP at three identical moments as an example.

[0171] Exemplary, combined Figure 4 According to the description in , after sending the interrupt signal 2, the AP can continue to send the interrupt signal 5 to the MCU at a preset time interval.

[0172] Then, after sending the interrupt signal 5, the AP can also perform the processing in S402 to S404 or S407 to S409 with the MCU, so that the MCU can obtain the timing results corresponding to the AP and the MCU at the time E. The time E corresponds to the time when the AP sends the interrupt signal 5 or the time when the MCU receives the interrupt signal 5.

[0173] For example, at time E, the timing result of the AP is time information t9, and the timing result of the MCU is time information t10. The MCU can determine the time difference D5 between the time information t9 and the time information t10, so that the MCU can obtain the time difference between the AP at time E.

[0174] In this example, the MCU can obtain function information E according to time information t2, time difference D1, time information t4, time difference D2, and time information t10, time difference D5. The function information E may include parameters 3 and 4 corresponding to straight line B. Straight line B is determined based on at least two sets of data among (time information t2, time difference D1), (time information t4, time difference D2), and (time information t10, time difference D5).

[0175] For example, parameter 3 may be the slope value k2 of straight line B, and parameter 4 may be the vertical intercept value b3 of straight line B.

[0176] For another example, parameter 3 may be the vertical intercept value b3 of straight line B, and parameter 4 may be the horizontal intercept value b4 of straight line B.

[0177] As an implementation method, the MCU can determine the straight line B corresponding to (time information t2, time difference D1), (time information t4, time difference D2) and (time information t10, time difference D5) by calling function method 1, and then obtain parameters 3 and 4 corresponding to straight line B. Among them, the function method 1 is used to implement linear fitting of (time information t2, time difference D1), (time information t4, time difference D2) and (time information t10, time difference D5). The function method 1 can include the least squares method.

[0178] As another implementation, the MCU can obtain the parameters 3 and 4 corresponding to the straight line B according to (time information t2, time difference D1) and (time information t10, time difference D5). Alternatively, the MCU can obtain the parameters 3 and 4 corresponding to the straight line B according to (time information t4, time difference D2) and (time information t10, time difference D5). Alternatively, the MCU can obtain the parameters 3 and 4 corresponding to the straight line B according to (time information t2, time difference D1) and (time information t4, time difference D2).

[0179] In addition, in Figure 4 He Ru Figure 6 In the description, the synchronization database is stored in the MCU as an example. In other embodiments of the present application, the synchronization database can be stored in the AP. Alternatively, the synchronization database can be stored in the AP and the MCU.

[0180] In this embodiment, the electronic device can perform the following operations according to a preset cycle and within a preset time: Figure 4 or Figure 6 The synchronous database is configured by the processing in the step 1404. The synchronous database may include a plurality of state information and function information respectively corresponding to the plurality of state information.

[0181] As another implementation manner, the synchronization database may be pre-configured in the electronic device.

[0182] In some embodiments of the present application, reference Figure 7 , the electronic device can calibrate the time information in the AP or MCU according to the synchronization database and the real-time status information of the electronic device, thereby realizing the time synchronization between the AP and the MCU.

[0183] like Figure 7 As shown, the program may include:

[0184] S701, AP and MCU initiate service A.

[0185] In some embodiments of the present application, the AP may initiate service A with the MCU, wherein service A requires time synchronization between the AP and the MCU.

[0186] In other embodiments of the present application, service A may also be referred to as the first service.

[0187] S702: The MCU obtains status information F corresponding to the electronic device.

[0188] For example, when the MCU detects that a service A occurs with the AP, it can obtain the current status information F corresponding to the electronic device.

[0189] For example, the state information F may include at least one of an identification mark 3 , temperature information 3 , and load information 3 of the electronic device.

[0190] In other embodiments of the present application, the state information F may also be referred to as first state information, the identity identifier 3 may also be referred to as first identity identifier, the temperature information 3 may also be referred to as first temperature information, and the load information 3 may also be referred to as first load information.

[0191] S703. MCU reads the synchronization database.

[0192] For example, when the MCU detects that a service A occurs with the AP, the MCU may also read the synchronization database. For a detailed description of the synchronization database, reference may be made to the above description, which will not be repeated here.

[0193] S704. The MCU searches the synchronization database according to the status information F.

[0194] Exemplarily, after acquiring the state information F and the synchronization database, the MCU may detect function information corresponding to the state information F in the synchronization database according to the state information F.

[0195] S705. The MCU determines whether the function information G corresponding to the state information F is retrieved in the synchronization database.

[0196] In the embodiment of the present application, the MCU can determine whether the function information G is retrieved in the synchronization data according to the state information F. Figure 4 In the description, the function information G is used to indicate the corresponding relationship between at least one moment 6 and the time difference C under the state information F. The time difference C is the time difference between the timing results of the first chip and the second chip at the moment 6.

[0197] As an implementation, the synchronization database does not include the state information F and the function information G. Accordingly, the MCU may determine that the function information G corresponding to the state information F is not retrieved from the synchronization database. In this implementation, the MCU may continue to execute the process in S706.

[0198] As another implementation, the synchronization database includes state information F and function information G. Accordingly, the MCU can determine that the function information G corresponding to the state information F is retrieved from the synchronization database. In this implementation, the MCU can jump to execute the process in S707.

[0199] In other embodiments of the present application, the function information G may also be referred to as the first function information, the time 6 may also be referred to as the fourth time, and the time difference C may also be referred to as the fourth time difference.

[0200] S706. The AP and MCU update the synchronization database.

[0201] Exemplarily, after the MCU determines that the function information G corresponding to the state information F is not retrieved in the synchronization database, the synchronization database may be updated so that the function information G corresponding to the state information F is included in the synchronization data.

[0202] Specifically, AP and MCU can be based on Figure 4 or Figure 6 The provided method includes the function information G and the state information F in the database 3, and stores the database 3 in the MCU, thereby realizing the update of the synchronous database.

[0203] Among them, the AP and MCU are based on the following Figure 4 Before updating the synchronization database using the method, the MCU may first request A to synchronize.

[0204] Accordingly, when receiving the synchronization request A, the AP can perform the processing in S401 to S413 with the MCU.

[0205] Thus, the MCU can obtain the function information G corresponding to the state information F.

[0206] S707. The MCU determines, based on the function information G, the time difference D6 corresponding to the time F and the AP.

[0207] In an embodiment of the present application, after the MCU retrieves the function information G corresponding to the status information F in the synchronization database, or completes the processing in S706 to obtain the function information G, the MCU can determine the time difference D6 between the time F and the AP based on the function information G.

[0208] In some other embodiments of the present application, the time F may also be referred to as the first time. The time difference D6 may also be referred to as the first time difference.

[0209] In some implementations, the MCU may perform time calibration according to the time difference D6, thereby achieving time synchronization with the AP.

[0210] For example, taking the time information corresponding to the MCU at time F as t11, the MCU can subtract the time difference D6 from the time information t11, so that the time information corresponding to the MCU at time F is consistent with that of the AP, thereby achieving time synchronization between the MCU and the AP.

[0211] In other implementations, after determining the time difference D6, the MCU may continue to perform the process in S707 so that the AP can obtain the time difference D6, so that the AP can subsequently perform time calibration according to the time difference D6 to achieve time synchronization with the MCU.

[0212] In other embodiments of the present application, the time information T11 may also be referred to as first time information.

[0213] S708. The MCU sends the time difference D6 to the AP.

[0214] S709. AP performs time calibration according to the time difference D6.

[0215] For example, after obtaining the time difference D6, the AP may perform time calibration according to the time difference D6, thereby achieving time synchronization with the MCU.

[0216] For example, if the time information corresponding to the AP at time F is t12, the AP can receive the time difference D6 in the time information t12. The AP can add the time difference D6 to the time information t12, so that the time information corresponding to the AP at time F is consistent with the MCU, thereby achieving time synchronization with the MCU.

[0217] As another implementation, the duration of the time difference D6 sent by the MCU to the AP is a preset duration, and the AP can perform time calibration according to the time difference D6 and the preset duration.

[0218] For example, the AP can add the time difference D6 to the time information t12 and subtract the duration T13 to make the time information corresponding to the AP at time F consistent with the time information t11 corresponding to the MCU at time F.

[0219] In other embodiments of the present application, the time information T12 may also be referred to as second time information.

[0220] It should be noted that in Figure 7In the description, the method for implementing time synchronization between the AP and the MCU is described by taking the AP and the MCU initiating service A as an example. In other embodiments of the present application, when the MCU enters the awake state from the sleep state, or after detecting that the electronic device has been powered on, the MCU and the AP perform the processing in S702 to S709 to implement time synchronization between the AP and the MCU.

[0221] In addition, in Figure 7 In the description, the time difference D6 determined by the MCU is taken as an example to illustrate the time synchronization between the AP and the MCU. In other embodiments of the present application, a synchronization database may be stored in the AP. The AP may obtain the time difference D7 between the MUC and the AP at time G based on the stored synchronization database and real-time status information. The AP or the MCU may subsequently perform time calibration based on the time difference D7 so that the time information corresponding to the MCU and the AP at time G remains consistent. Thus, the time synchronization between the AP and the MCU is achieved.

[0222] The implementation method of the AP obtaining the time difference D7 according to the synchronization database and the real-time status information of the electronic device, and the implementation method of the AP or MCU performing time calibration according to the time difference D7, and Figure 7 Similar, for specific content, please refer to Figure 7 The instructions in the article are not repeated here.

[0223] exist Figure 4 , Figure 6 as well as Figure 7 In the description, the first chip is MCU and the second chip is AP as an example to illustrate the implementation method of time synchronization between the first chip and the second chip. In other embodiments of the present application, the first chip can also be a chip other than MCU, and the second chip can also be a chip other than AP.

[0224] For example, the first chip may include a baseband processor, a GPU, a DSP, etc., and the second chip may include a global positioning system (GPS), etc. The embodiment of the present application does not impose any special restrictions on the specific types of the first chip and the second chip.

[0225] In some other embodiments of the present application, the first chip and the second chip may be configured in two different electronic devices.

[0226] In addition, Figure 4 , Figure 6 as well as Figure 7In the description of the present invention, two chips (such as the first chip and the second chip) are used as an example to illustrate the implementation method of time synchronization between chips. In other embodiments of the present application, at least three chips can be configured according to Figure 4 , Figure 6 as well as Figure 7 The time synchronization between the at least three chips is achieved by the method provided in the embodiment.

[0227] The at least three chips may include a master chip and at least two slave chips. The at least three chips may be configured in one electronic device. Alternatively, the at least three chips may be configured in different electronic devices.

[0228] In this embodiment, the master chip can obtain a synchronization database corresponding to each slave chip. The master chip can obtain the time difference between the master chip and each slave chip at the target time based on the synchronization database. The electronic device can calibrate the time information corresponding to the slave chip at the target time based on the time difference corresponding to each slave chip. The time information corresponding to the master chip and each slave chip at the target time is kept consistent, thereby achieving time synchronization between more than two chips.

[0229] The specific implementation of this embodiment can be referred to Figure 4 , Figure 6 as well as Figure 7 The relevant instructions in will not be repeated here.

[0230] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of electronic equipment. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, 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 be beyond the scope of this application.

[0231] refer to Figure 8 , is a schematic diagram of another electronic device 800 provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 may include: a processor 801 and a memory 802. The memory 802 is used to store computer-executable instructions. Exemplarily, in some embodiments, when the processor 801 executes the instructions stored in the memory 802, the electronic device 800 may execute any of the methods shown in the above embodiments.

[0232] in, Figure 8 The processor 801 in may include an AP.

[0233] It should be noted that 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.

[0234] Fig. 9 A schematic diagram of the composition of a chip system 900 is shown. The chip system 900 may include: a processor 901 and a communication interface 902, which are used for the electronic device to implement the functions involved in the above embodiments. In a possible design, the chip system also includes a memory for storing program instructions and data necessary for the electronic device. The chip system may be composed of chips, or may include chips and other discrete devices. It should be noted that in some implementations of the present application, the communication interface 902 may also be referred to as an interface circuit.

[0235] In addition, the chip system 900 may correspond to an AP or an MCU.

[0236] It should be noted that 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.

[0237] The functions or actions or operations or steps in the above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may include one or more servers, data centers and other data storage devices that can be integrated with the medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0238] 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 synchronization method, characterized in that: The method is applied to a first chip, the first chip is set in an electronic device; the first chip is communicatively connected with a second chip; the first chip and the second chip are used to collaboratively process a first service; the method includes: After the electronic device is turned on, first status information is obtained; the first status information includes at least one of the following: first temperature information, first load information, and a first identity identifier of the electronic device; According to the first state information, a first time difference is acquired; the first time difference is used to indicate the time difference between the first time information and the second time information under the first state information, the first time information is the timing result of the first chip at the first moment; the second time information is the timing result of the second chip at the first moment; The acquiring the first time difference value according to the first state information comprises: determining first function information according to the first state information; determining the first time difference value according to the first function information; The first function information corresponds to the first state information; the first function information is used to indicate the corresponding relationship between at least one fourth moment and a fourth time difference under the first state information; the fourth time difference is the time difference between the timing result of the first chip at the fourth moment and the timing result of the second chip at the fourth moment; the fourth moment includes the first moment; The timing results of the first chip and the second chip are synchronized according to the first time difference.

2. The method according to claim 1, characterized in that The performing time synchronization on the timing results of the first chip and the second chip according to the first time difference includes: The first chip adjusts the first time information according to the first time difference so that the first time information is synchronized with the second time information.

3. The method according to claim 1, characterized in that The performing time synchronization on the timing results of the first chip and the second chip according to the first time difference includes: The first chip sends the first time difference to the second chip, so that the second chip adjusts the second time information according to the first time difference.

4. The method according to any one of claims 1 to 3, characterized in that The electronic device is also equipped with the second chip.

5. The method according to claim 4, characterized in that The electronic device stores a synchronization database; the synchronization database includes at least one second function information and second state information corresponding to the second function information; the second function information is used to indicate the corresponding relationship between at least one fifth moment and the fifth time difference under the second state information; The fifth time difference is the time difference between the timing result of the first chip at the fifth moment and the timing result of the second chip at the fifth moment; the second state information includes at least one of the following: second temperature information of the electronic device, second load information and the first identity; The determining, according to the first state information, first function information comprises: The first function information is acquired from the synchronization database according to the first state information.

6. The method according to claim 5, characterized in that Before acquiring the first function information according to the first state information, the method further includes: The synchronization database is configured according to the first status information.

7. The method according to claim 6, characterized in that Before configuring the synchronization database, the method further includes: Under the first state information, obtaining third time information, fourth time information, fifth time information and sixth time information; The third time information is the timing result of the first chip at the second moment; the fourth time information is the timing result of the second chip at the second moment; the fifth time information is the timing result of the first chip at the third moment; the sixth time information is the timing result of the second chip at the third moment; Determine a second time difference and a third time difference; the second time difference is the time difference between the third time information and the fourth time information; the third time difference is the time difference between the fifth time information and the sixth time information.

8. The method according to claim 7, characterized in that The configuring the synchronization database comprises: Determine the first function information according to the second moment and the second time difference, and the third moment and the third time difference; The first function information and the first state information are included in the synchronization database.

9. The method according to claim 8, characterized in that Before acquiring the third time information, the fourth time information, the fifth time information and the sixth time information, the method further includes: At the second moment, the first chip receives a first interrupt signal; At the third moment, the first chip receives a second interrupt signal; The first interrupt signal and the second interrupt signal are sent by the second chip.

10. The method according to claim 9, characterized in that The third time information is a timing result of the first chip when receiving the first interrupt signal; The fourth time information is a timing result of the second chip when sending the first interrupt signal; The fifth time information is a timing result of the first chip when receiving the second interrupt signal; The sixth time information is a timing result of the second chip when sending the second interrupt signal.

11. The method according to any one of claims 8 to 10, characterized in that: Describing the configuration of the synchronization database includes: When the first function information corresponding to the first state information is not retrieved from the synchronization database, the synchronization database is configured.

12. The method according to any one of claims 8 to 10, characterized in that: Describing the configuration of the synchronization database includes: After the electronic device is turned on, the synchronization database is configured within a preset time according to a preset cycle.

13. The method according to any one of claims 1 to 3, characterized in that: After the electronic device is powered on, obtaining the first status information includes: When the first chip and the second chip collaboratively process the first service, acquiring the first status information; Alternatively, when the electronic device switches from a sleep state to a wake-up state, the first state information is acquired.

14. The method according to claim 13, characterized in that The first service requires time synchronization between the first chip and the second chip.

15. The method according to any one of claims 1 to 3, characterized in that: The first chip includes a microcontroller unit MCU; The second chip includes an application processor AP.

16. An electronic device, characterized in that: The electronic device comprises: a memory and one or more processors; the memory and the processor are coupled; the electronic device further comprises a first chip; The first chip and the second chip are communicatively connected, and the first chip and the second chip are used to collaboratively process a first business; the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method as described in any one of claims 1-15.

17. The electronic device according to claim 16, characterized in that: The electronic device also includes the second chip.

18. A chip system, characterized in that: The chip system includes a processor and a communication interface; the chip system includes a first chip; the first chip is communicatively connected with a second chip, and the first chip and the second chip are used to collaboratively process a first service; The processor is used to call and run a computer program stored in a storage medium from the storage medium to execute the method according to any one of claims 1 to 15.

19. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 15 are implemented.

Citation Information

Patent Citations

  • Power adjusting method and device, storage medium and terminal

    CN111510901A

  • Time synchronization method, electronic equipment, chip and readable storage medium

    CN116744162A

  • Clock synchronization method and electronic equipment

    CN117411580A