Electronic terminal, timing method, storage medium and computer equipment
Through the collaborative design of the communication module and the control module, standard time and interrupt instructions are obtained synchronously to achieve time calibration at the hardware level, which solves the problems of electronic terminal time synchronization errors and complex time calibration processes in the existing technology, and significantly improves the time calibration accuracy and reliability.
Patent Information
- Application Number
- CN202510893574.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-23
AI Technical Summary
The time synchronization of existing electronic terminals has errors, making it difficult to meet the high-precision requirements at the microsecond level. In addition, the time calibration process is complex and relies on manual intervention. It is easily affected by data transmission delays and electromagnetic interference, and lacks an automatic recovery mechanism.
Through the collaborative design of the communication module and the control module, standard time and interrupt instructions are obtained synchronously, and time calibration is performed at the hardware level. The high processing priority of the interrupt signal is used to achieve microsecond-level time synchronization, simplify the time calibration process, and reduce the impact of data transmission delays and protocol parsing time.
It achieves high-precision time synchronization, meets microsecond-level requirements, improves time synchronization efficiency and reliability, avoids error accumulation and manual intervention, and ensures the real-time and reliability of time synchronization.
Smart Images

Figure CN120686572A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of timing technology, and in particular to an electronic terminal, a time calibration method, a storage medium, and a computer device. Background Art
[0002] In fields such as power meters, the Internet of Things, and mobile communications, time synchronization among related electronic devices is a fundamental prerequisite for collaborative operation, data collection, and analysis. However, due to factors such as drift in the terminal's own clock and network latency, time synchronization between devices often exhibits errors. This time synchronization error can lead to data inconsistencies and failures in collaborative operation, seriously impacting the stability and reliability of the terminals. Therefore, timely calibration of the internal time of these electronic terminals is essential.
[0003] In the prior art, satellite-based time synchronization methods are the mainstream solution, which achieve time calibration of electronic terminals by receiving time signals transmitted by satellites. However, existing technologies mostly rely on software-level time data analysis, often directly using satellite system time without synchronization verification. The calibration process is complex and often requires manual intervention. It is susceptible to factors such as data transmission delays and time-consuming protocol parsing, resulting in time synchronization errors. As a result, the terminal cannot accurately record the local time difference, affecting the final calibration effect. Its accuracy is usually only up to milliseconds, which is difficult to meet the requirements of microsecond-level high-precision scenarios. At the same time, because satellite signals are susceptible to obstruction or electromagnetic interference, resulting in time source interruption, and the communication interface of traditional time synchronization systems lacks anti-interference optimization, noise is easily introduced during signal transmission, further reducing time synchronization reliability. In addition, when the satellite signal processing module fails, the existing system also lacks an automatic recovery mechanism, which may cause local devices to synchronize based on erroneous time data, causing system time disorder. If time synchronization requests are still responded to during the abnormal period, the accumulation of time errors may be exacerbated, making it difficult to ensure long-term calibration accuracy. Summary of the Invention
[0004] This application mainly provides an electronic terminal, a time calibration method, a storage medium and a computer device, aiming to solve the technical problem of low time calibration accuracy of existing electronic terminals.
[0005] In order to solve the above technical problems, the technical solution adopted in this application is: to provide an electronic terminal, which includes a control module and a communication module connected to each other; the communication module is used to simultaneously obtain the standard time and generate an interrupt instruction, and send the interrupt instruction and the standard time to the control module at the same time; the control module is used to record the interrupt reception time when the interrupt instruction is received, and calibrate the current terminal time based on the time difference between the interrupt reception time and the standard time.
[0006] In some embodiments, the control module includes a control unit module and a time management module connected to each other; the communication interface of the control unit module is used to connect to the communication module, receive the standard time issued by the communication module, and forward the standard time to the time management module; the interrupt interface of the time management module is used to connect to the communication module, receive the interrupt instruction issued by the communication module, and record the interrupt reception time of receiving the interrupt instruction, and calibrate the current terminal time based on the time difference between the interrupt reception time and the standard time.
[0007] In some embodiments, the control unit module is also used to send a read time instruction to the communication module to instruct the communication module to respond and monitor the standard time issued by the communication module; the time management module is also used to monitor the interrupt instruction issued at the same time as the standard time.
[0008] In some embodiments, the communication module includes a connected satellite timing module and a communication processing module; the satellite timing module is used to obtain satellite system time from the global satellite navigation system, and forward the satellite system time to the communication processing module, and send a second pulse signal to the communication processing module; the communication processing module is used to add seconds to the satellite system time and temporarily store it to obtain a temporary time, and in response to receiving the second pulse signal, use the temporary time as the standard time.
[0009] In some embodiments, the communication processing module is also used to send the standard time to the control module in response to receiving the read time instruction sent by the control module, and at the same time send the interrupt instruction to the control module so that the control module can calibrate the current terminal time.
[0010] In some embodiments, the communication processing module is also used to detect the operating status of the satellite timing module and restart the satellite timing module when the operating status is abnormal. If the read time instruction of the control module is received during the restart process, an invalid identification value is returned to the control module.
[0011] In some embodiments, the control module and the communication module are connected via RS232, RS485 or a controller area network bus, and communicate via a network time protocol or a precision time protocol.
[0012] In order to solve the above technical problems, another technical solution adopted in this application is: to provide a time calibration method, which is applied to the electronic terminal as mentioned above, including: simultaneously obtaining the standard time and generating an interrupt instruction through the communication module, and sending the interrupt instruction and the standard time to the control module at the same time; recording the interrupt reception time of the interrupt instruction through the control module, and calibrating the current terminal time based on the time difference between the interrupt reception time and the standard time.
[0013] In order to solve the above technical problems, another technical solution adopted in this application is: providing a storage medium on which program data is stored, characterized in that when the program data is executed by a processor, the steps of the above-mentioned time calibration method are implemented.
[0014] To solve the above technical problems, another technical solution adopted in this application is: to provide a computer device, which includes a processor and a memory connected to each other, the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the time calibration method as described above.
[0015] The beneficial effects of the present application are as follows: Different from the prior art, the present application discloses an electronic terminal, a time calibration method, a storage medium and a computer device. The electronic terminal of the present application realizes the synchronous transmission and automatic calibration of standard time and interrupt instructions through the collaborative design of the communication module and the control module. Specifically, the communication module generates an interrupt instruction while obtaining the standard time, and sends the two to the control module synchronously, so that the control module can accurately record the time difference between the interrupt reception time and the standard time, thereby achieving high-precision time calibration, which not only simplifies the time calibration process, but also effectively reduces the influence of factors such as data transmission delay and protocol parsing time through synchronous transmission at the hardware level, significantly improves the time calibration accuracy, and enables the electronic terminal of the present application to meet the microsecond-level high-precision scenario requirements, avoids the error accumulation of traditional solutions, and the process does not require manual intervention, which solves the problem of complex calibration process and reliance on manual operation in the prior art, significantly improves the efficiency and reliability of time calibration, and fundamentally improves the time synchronization performance of the electronic terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. Those skilled in the art can also derive other drawings based on these drawings without inventive work, among which: Figure 1 This is a schematic structural diagram of an embodiment of an electronic terminal provided by the present application; Figure 2 yes Figure 1 A schematic structural diagram of a specific embodiment of an electronic terminal of an embodiment; Figure 3 This is a flow chart of an embodiment of a time calibration method provided by the present application; Figure 4 yes Figure 3 A schematic diagram of the interaction flow of a specific embodiment of the time synchronization method of the embodiment; Figure 5 This is a schematic structural diagram of an embodiment of a storage medium provided by the present application; Figure 6 It is a structural diagram of an embodiment of a computer device provided by this application. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0018] The terms "first", "second" and "third" in the embodiments of the present application are only used for descriptive purposes 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", "second" and "third" may explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally also include steps or units that are not listed, or may optionally also include other steps or units inherent to these processes, methods, products or devices.
[0019] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0020] This application provides an electronic terminal, see Figure 1 , Figure 1The figure is a schematic diagram of the structure of an embodiment of an electronic terminal 100 provided in this application. The electronic terminal 100 includes a control module 110 and a communication module 120 connected to each other. The communication module 120 is configured to simultaneously obtain the standard time and generate an interrupt instruction, and send the interrupt instruction and the standard time to the control module 110. The control module 110 is configured to record the interrupt reception time when the interrupt instruction is received and calibrate the current terminal time based on the time difference between the interrupt reception time and the standard time.
[0021] In this embodiment, the provided electronic terminal 100 can specifically be a device that requires high-precision time synchronization, such as an electric power meter, an Internet of Things terminal, or a mobile communication device. For example, when the electronic terminal 100 is an electric power meter, it is necessary to maintain time synchronization with the power grid master station, other power monitoring nodes, and smart meters to ensure the consistency of electric energy data collection and the synchronization of fault recording time. These electronic terminals 100 generally include a control module 110 and a communication module 120, wherein the control module 110 is responsible for data processing and instruction execution, and the communication module 120 is responsible for information interaction with external systems. In the time synchronization business of traditional electronic terminals 100, the communication module 120 needs to be able to establish a connection with a satellite or ground time server to obtain accurate system time, and the control module 110 needs to be able to perform corresponding time synchronization operations based on the system time to ensure that the local clock of the electronic terminal 100 is highly consistent with the standard time.
[0022] In this embodiment, standard time refers to a reference time signal with high accuracy and stability provided by an authoritative time source, such as a satellite or terrestrial time server. When acquiring the standard time, the communication module 120 of the present application generates an interrupt signal and immediately transmits the interrupt signal and the standard time to the control module 110. The interrupt signal is a hardware-triggered instantaneous signal, such as a rising or falling edge transition of a GPIO (General-Purpose Input / Output) pin. Due to the interrupt signal's high processing priority and high response speed, when the terminal signal reaches the control module 110, the control module 110 can typically record the interrupt reception time with extremely low latency and high precision, typically achieving a time resolution of microseconds or even nanoseconds, ensuring accurate time synchronization.
[0023] In this embodiment, due to the instantaneous nature of the interrupt signal, the communication module 120 simultaneously transmits the standard time and the interrupt signal, ensuring that the control module 110 can immediately determine the standard time transmission time upon receiving the interrupt signal. Specifically, the interrupt reception time when the interrupt signal is received typically differs from the standard time by only microseconds or even nanoseconds. Therefore, the interrupt reception time can be determined as the time recorded by the standard time under the current terminal time system. For example, the standard time is 12:00:00.000000, and the interrupt reception time recorded under the current terminal time system is 12:00:00.010000. However, the actual interrupt reception time under the standard time system should be 12:00:00.000001. The actual difference with the standard time is extremely small, so the interrupt reception time can be considered an exact reflection of the standard time. The difference between the interrupt reception time recorded under the current terminal time system and the standard time is the time synchronization error. Based on this, the current terminal time can be calibrated based on the time difference between the interrupt reception time and the standard time.
[0024] In this embodiment, it should be understood that the interrupt signal is only a rising edge or falling edge trigger signal. When it reaches the control module 110, the control module 110 will not know the specific value of the standard time sent at the same time. Therefore, it is usually necessary to wait for the control module 110 to receive the standard time and then perform time calibration. For example, the standard time T0 is 12:00:00.000000. After the communication module obtains the standard time T0, it will send the standard time T0 and the interrupt signal to the control module 110 at the same time. The control module 110 records the interrupt reception time T1 as 12:00:00.010000 in its original time system, and then records the moment T2 of receiving the standard time as 12:00:00.020000 in its original time system. Then, it will calculate the time difference between the interrupt reception time T1 and the standard time T0 as 12:00:00.010000-12:00 at or after the moment T2 in the original time system. 0:00.000000 = 0.010000 seconds, so the time synchronization error is 0.010000 seconds. Based on this, the current terminal time is accurately calibrated. For example, if the time is calibrated at 12:00:00.020000, the current terminal time in the standard time system is determined to be 12:00:00.020000 - 0.10000 seconds = 12:00:00.010000 seconds. Therefore, the current terminal time of 12:00:00.020000 in the original time system is corrected to 12:00:00.010000 seconds in the standard time system, thus achieving accurate synchronization of the current terminal time.
[0025] In the time synchronization method implemented by the electronic terminal 100 of this embodiment, the accuracy error between the calibrated current terminal time and the standard time is only caused by the transmission delay of the interrupt signal and its sending and receiving processing time, which is usually in the microsecond or even nanosecond level. Compared with the millisecond or even second-level errors caused by communication delays, protocol analysis time and processor scheduling delays in the traditional time synchronization method, the accuracy of time synchronization is significantly improved. At the same time, due to the high processing priority of the interrupt signal, even when the electronic terminal 100 is processing other high-priority tasks, it can ensure that the interrupt signal is processed in a timely manner, thereby further ensuring the real-time and reliability of time synchronization. The structure of the electronic terminal 100 and the communication mechanism between the structures can achieve high-precision time calibration, which not only simplifies the time synchronization process, but also effectively reduces the influence of factors such as data transmission delay and protocol analysis time through synchronous transmission at the hardware level, significantly improving the time synchronization accuracy, so that the electronic terminal 100 of this application can meet the needs of microsecond-level high-precision scenarios and avoid the error accumulation of traditional solutions. In addition, this process does not require manual intervention, which solves the problem of complex calibration process and reliance on manual operation in the existing technology, significantly improves the efficiency and reliability of time calibration, and fundamentally improves the time synchronization performance of the electronic terminal 100.
[0026] See Figure 2 , Figure 2 yes Figure 1 A schematic structural diagram of an electronic terminal 100 according to a specific embodiment.
[0027] Optionally, in some embodiments, the control module 110 includes a control unit module 111 and a time management module 112 connected to each other; the communication interface of the control unit module 111 is used to connect to the communication module 120, and receive the standard time issued by the communication module 120, and forward the standard time to the time management module 112; the interrupt interface of the time management module 112 is used to connect to the communication module 120, receive the interrupt instruction issued by the communication module 120, and record the interrupt reception time of the interrupt instruction, and calibrate the current terminal time based on the time difference between the interrupt reception time and the standard time.
[0028] This optional embodiment further specifies the modular composition of the control module 110. Specifically, the control module 110 includes a control unit module 111 and a time management module 112. The control unit module 111 can be a microcontroller unit (MCU), a central processing unit (CPU), or an application-specific integrated circuit (ASIC), as long as the control module 110 can perform data processing, protocol parsing, and inter-module communication coordination. The time management module 112 can be a time management unit (TMU), a real-time clock (RTC), or a high-precision timer, as long as it can perform time recording, time synchronization, and time calibration functions.
[0029] In this optional embodiment, the control unit module 111 and the time management module 112 are interconnected and work together to achieve high-precision time synchronization of the electronic terminal 100. Specifically, the control unit module 111 is connected to the communication module 120, and its communication interface is used to receive the standard time information sent by the communication module 120 and forward the standard time information to the time management module 112. The time management module 112 is connected to the communication module 120 through its interrupt interface, and is used to receive the interrupt instruction sent by the communication module 120, and record the interrupt reception time when receiving the interrupt instruction. Finally, based on the time difference between the recorded interrupt reception time and the received standard time information, the current terminal time can be accurately calibrated. The specific process can be referred to the above description and will not be repeated here. The communication interface is used for data transmission with systems or devices external to the control module 110, such as a serial communication interface such as RS-232, RS-485, USB (Universal Serial Bus), or Controller Area Network (CAN) bus, or a network communication interface such as Ethernet, Wi-Fi, or Bluetooth. As long as the communication interface can transmit and receive data, it will be sufficient. In this solution, a serial communication interface is preferably used to ensure stable and real-time data transmission. The interrupt interface of the time management module 112 is a hardware interface for receiving interrupt instructions, such as a GPIO pin or interrupt controller. When the communication module 120 sends an interrupt instruction to the time management module 112 via this interrupt interface, the time management module 112 can immediately respond and record the current interrupt reception time.
[0030] Optionally, in some embodiments, the control unit module 111 is also used to send a read time instruction to the communication module 120 to instruct the communication module 120 to respond and monitor the standard time issued by the communication module 120; the time management module 112 is also used to monitor the interrupt instruction issued at the same time as the standard time.
[0031] In this optional embodiment, the process of the control module 110 obtaining the standard time and the interrupt instruction for time calibration by actively requesting is further specified. Specifically, the control unit module 111 can actively send a read time instruction to the communication module 120 to trigger the communication module 120 to obtain the standard time from the authoritative time source. The read time instruction is an instruction signal for starting the time synchronization process initiated by the control module 110 to the communication module 120, which is used to instruct the communication module 120 to respond to the read time instruction to start the time synchronization process, obtain the latest standard time from the authoritative time source, generate an interrupt instruction, and send the standard time and interrupt instruction to the control unit module 111 and the time management module 112 respectively.
[0032] In this optional embodiment, after the control unit module 111 issues the read time instruction, the control unit module 111 can enter a monitoring state and instruct the time management module 112 to enter a corresponding monitoring state to prepare to receive the standard time and interrupt instruction sent by the communication module 120. The control unit module 111 can monitor the standard time through its communication interface, while the time management module 112 can monitor the interrupt instruction through its interrupt interface. Once the communication module 120 obtains the standard time from the authoritative time source and generates an interrupt instruction, the communication module 120 will immediately send the standard time and interrupt instruction to the control unit module 111 and the time management module 112 respectively. After receiving the standard time through its communication interface, the control unit module 111 will forward it to the time management module 112. At the same time, after receiving the interrupt instruction through its interrupt interface, the time management module 112 will immediately record the moment of receipt of the interrupt instruction as the interrupt reception time. Based on this, the time management module 112 can accurately calibrate the current terminal time based on the time difference between the recorded interrupt reception time and the received standard time, thereby achieving high-precision time synchronization of the electronic terminal 100.
[0033] Optionally, in some embodiments, the communication module 120 includes a connected satellite timing module 121 and a communication processing module 122; the satellite timing module 121 is used to obtain the satellite system time from the global satellite navigation system, and forward the satellite system time to the communication processing module 122, and send a second pulse signal to the communication processing module 122; the communication processing module 122 is used to add seconds to the satellite system time and temporarily store it to obtain the temporary time, and in response to receiving the second pulse signal, use the temporary time as the standard time.
[0034] In this optional embodiment, the module composition and module-based collaborative workflow of the communication module 120 are further specified. Specifically, the communication module 120 includes a satellite timing module 121 and a communication processing module 122 connected to each other. The satellite timing module 121 is specifically configured to obtain satellite system time from a global navigation satellite system (GNSS), such as the Beidou Navigation Satellite System (BDS), the Global Positioning System (GPS), the Galileo Navigation Satellite System (Galileo), or the GLONASS satellite navigation system, and forward the time data to the communication processing module 122 in real time. At the same time, it sends a precise 1 Pulse Per Second (1PPS) signal to synchronize the time base. The 1PPS signal can be generated by a satellite signal receiver within the satellite timing module 121 , and based on the time information calculated from the satellite signal and an internal high-stability crystal oscillator, it undergoes signal processing such as frequency conversion demodulation and is then sent out for synchronization with the communication processing module 122 . The rising or falling edge of the 1PPS signal is strictly aligned with the whole second of the satellite system time, and the time accuracy can reach the nanosecond level. The satellite timing module 121 can specifically select a timing module corresponding to a satellite navigation system, such as a Beidou timing module, a GPS timing module, or a multi-mode compatible timing module to achieve compatibility and time synchronization of different satellite navigation systems.
[0035] In this optional embodiment, after receiving the satellite system time, the communication processing module 122 will add seconds to it and temporarily store it. That is, the received satellite system time is used as a reference and one second is added to it for temporary storage. When the second pulse signal is received, the temporary storage time is accurately aligned to the whole second, ensuring the accuracy and stability of time synchronization. For example, if the received satellite system time is 10:00:00.000000, the temporary storage time is 10:00:01.000000. The one second period after the communication processing module 122 receives the satellite system time is generally sufficient to receive, process, verify, and temporarily store the satellite system time. This ensures that when the second pulse signal arrives, the temporary storage time is accurately aligned to the whole second, effectively eliminating time errors and ensuring the efficient and reliable coordination of various modules in the system. After receiving the second pulse signal, the communication processing module 122 can also immediately output the temporary storage time as the standard time. The communication processing module 122 can specifically be a cellular communication module such as 4G, 5G, and RedCap, or other chips or modules with corresponding data processing and communication functions, such as a dedicated microprocessor, digital signal processor, or communication controller. The communication processing module 122 further optimizes the time calibration process through a high-precision clock synchronization algorithm.
[0036] In this optional embodiment, the communication module 120, through the close collaboration of the satellite timing module 121 and the communication processing module 122, implements the entire process of acquiring satellite system time, adding seconds to storage, and emitting high-precision time using second pulses. This process is actually also the process of calibrating the internal time of the communication processing module 122, ensuring that the internal time of the communication processing module 122 is accurately synchronized with the global satellite navigation system time. This, together with the subsequent processing of the control module 110, forms a dual calibration mechanism. It is worth noting that the data transmission and synchronization process between the communication processing module 122 and the satellite timing module 121 are both implemented through hardware-level interfaces and signals, avoiding protocol parsing and data processing delays at the software level, thereby further improving the accuracy and real-time performance of time synchronization. On this basis, the control unit module 111 and the time management module 112 can accurately calibrate the current terminal time based on the received standard time and interrupt instructions, achieving high-precision synchronization of the electronic terminal 100 with the global satellite navigation system time. The design and workflow of the communication module 120 not only simplifies the time synchronization process, but also effectively reduces the impact of factors such as data transmission delay and protocol parsing time through synchronous transmission and precise calibration at the hardware level, significantly improving the accuracy and reliability of time synchronization, enabling the electronic terminal 100 to meet higher-precision time synchronization requirements and providing strong support for various high-precision application scenarios.
[0037] Optionally, in some embodiments, the communication processing module 122 is also used to send the standard time to the control module 110 in response to receiving a read time instruction sent by the control module 110, and at the same time send an interrupt instruction to the control module 110 so that the control module 110 can calibrate the current terminal time.
[0038] This optional embodiment further details the response process of the communication processing module 122 after receiving a command from the control module 110. Specifically, the communication processing module 122 not only performs internal time calibration based on the standard time and pulse-per-second signal obtained by the satellite timing module 121, but also executes the corresponding time synchronization process in response to a read time command sent by the control module 110. Upon receiving this read time command, the communication processing module 122 immediately obtains the latest standard time from the calibrated internal time and sends this standard time to the control unit module 111 in the control module 110 via the communication interface. Simultaneously, the communication processing module 122 also generates an interrupt command and sends it to the time management module 112 in the control module 110 via the interrupt interface. This interrupt command triggers the time management module 112 to record the moment the interrupt command was received, i.e., the interrupt reception time, so that the current terminal time can be accurately calibrated based on the time difference between the interrupt reception time and the received standard time. Through this design, the communication processing module 122 can work closely with the control module 110 to achieve high-precision synchronization of the electronic terminal 100 with the global satellite navigation system time. In addition, the communication processing module 122 can flexibly adjust the frequency and accuracy of time synchronization according to actual needs to meet the requirements of different application scenarios, thereby further improving the time synchronization performance and applicability of the electronic terminal 100. The time read instruction, interrupt instruction, and corresponding response action can be specifically referred to the interaction process between the control module 110 and the communication module 120 described above, and will not be repeated here.
[0039] Optionally, in some embodiments, the communication processing module 122 is also used to detect the operating status of the satellite timing module 121, and restart the satellite timing module 121 when the operating status is abnormal, and if a read time instruction is received from the control module 110 during the restart process, an invalid identification value is returned to the control module 110.
[0040] This optional embodiment further specifies the communication processing module 122's monitoring of the satellite timing module 121's operating status and its abnormality recovery mechanism. Specifically, the communication processing module 122 has the function of real-time monitoring of the satellite timing module 121's operating status. This function can be implemented through hardware-level interfaces and signals, or in combination with software-level algorithms and logic, to monitor the satellite timing module 121's operating status in real time, such as key indicators such as signal reception strength and data parsing success rate. When the satellite timing module 121 is operating normally and continuously providing accurate satellite system time, the communication processing module 122 performs internal time calibration based on this time data and responds to the control module 110's read time command by sending a standard time and interrupt command. However, if the communication processing module 122 detects an abnormality in the satellite timing module 121's operating status, such as an inability to receive satellite signals, abnormal time data, or loss of the pulse-per-second signal, the communication processing module 122 immediately activates the abnormality recovery mechanism and attempts to restart the satellite timing module 121 to restore normal operation.
[0041] In this optional embodiment, during the process of restarting the satellite timing module 121, if the communication processing module 122 receives a time reading instruction from the control module 110, since the satellite timing module 121 may not have fully recovered and cannot provide accurate time data at this time, the communication processing module 122 will not send a valid standard time, but will return an invalid identification value to the control module 110 to indicate that the current time data of the control module 110 is unavailable. If an invalid identification value is returned, the control module 110 can perform corresponding error processing based on the invalid identification value, such as recording an error log, issuing an alarm prompt, or trying to use other time synchronization methods, etc., to ensure that the time synchronization function of the electronic terminal 100 is not affected. During this process, the control module 110 can maintain the clock state under the original terminal time system to avoid system disorder caused by abnormal time data. Through this mechanism, the electronic terminal 100 can not only effectively deal with sudden failures of the satellite timing module 121, but also maintain the stability and reliability of time synchronization under abnormal circumstances, ensuring that it can still operate normally in various complex environments, and effectively prevent the control module 110 from performing time calibration based on inaccurate or invalid time data when the satellite timing module 121 is abnormal, thereby ensuring the accuracy and reliability of the time synchronization of the electronic terminal 100.
[0042] In this optional embodiment, the communication processing module 122 may also optionally have the self-detection and diagnosis capabilities of an abnormality recovery mechanism, and may automatically detect whether the satellite timing module 121 has returned to normal working condition after being restarted. If the satellite timing module 121 still fails to work properly after being restarted, the communication processing module 122 will record the corresponding error information and may trigger further fault handling procedures, such as issuing a warning to the user, attempting to switch to an alternative time source, or executing other recovery measures to ensure that the time synchronization function of the electronic terminal 100 is not affected. Through these designs, the communication processing module 122 can effectively monitor and handle abnormalities of the satellite timing module 121, further improve the stability and reliability of the time synchronization of the electronic terminal 100, avoid data synchronization based on erroneous time, system time disorder, and error accumulation that may be caused by the lack of an automatic recovery mechanism, and effectively ensure long-term calibration accuracy.
[0043] Optionally, in some embodiments, the control module 110 and the communication module 120 are connected via RS232, RS485 or a controller area network bus, and communicate via the Network Time Protocol or the Precision Time Protocol.
[0044] This optional embodiment specifies the connection method and communication protocol between modules. Specifically, the connection method and communication protocol between the control module 110 and the communication module 120 are crucial for achieving efficient and reliable time synchronization. RS232 and RS485, as common serial communication interface standards, have advantages such as long transmission distance and strong anti-interference capabilities, making them suitable for connections between various industrial environments and devices. The Controller Area Network bus, on the other hand, has advantages such as multiple master stations, strong real-time data communication, and high reliability. These connection methods ensure the stability and reliability of data transmission between the control module 110 and the communication module 120. Furthermore, the Network Time Protocol (NTP) and the Precision Time Protocol (PTP), as high-precision time synchronization protocols, are respectively suitable for time synchronization scenarios with different accuracy requirements. The NTP protocol, through a hierarchical time server architecture, can achieve time synchronization between different devices within the network and is suitable for most application scenarios. The PTP protocol, based on hardware timestamps and a precise timestamp transmission mechanism, can achieve sub-microsecond or even nanosecond time synchronization and is suitable for applications with extremely high time accuracy requirements. By selecting a suitable connection method and communication protocol, it is possible to ensure that the electronic terminal 100 can achieve high-precision time synchronization in different application scenarios, meeting the needs of various high-precision application scenarios.
[0045] Optionally, in some embodiments, the control module 110 further includes an artificial intelligence module, which is connected to the control unit module 111 and is used to adjust the deviation of the current terminal time based on intelligent analysis.
[0046] In this optional embodiment, the current terminal time may still deviate due to factors such as interrupt signal transmission delays, uncertain transceiver processing efficiency, and clock drift. Although the deviation is at the microsecond or even nanosecond level, it can still affect system operation in scenarios requiring higher precision. To this end, the control module 110 can further improve the accuracy and adaptability of time synchronization by integrating an artificial intelligence module. This artificial intelligence module is closely connected to the control unit module 111 and can intelligently analyze and adjust the deviation of the current terminal time based on advanced technologies such as deep learning and big data analysis. Specifically, the artificial intelligence module can receive the current terminal time and related time synchronization data from the control unit module 111, such as satellite system time, interrupt reception time, standard time, etc., and then use this data to train and optimize the time synchronization model. This model can learn and identify various sources of error in the time synchronization process, such as interrupt signal transmission delays, changes in transceiver processing efficiency, clock drift, etc., and accurately adjust the deviation of the current terminal time based on these characteristics and other environmental or system characteristics. Through this design, the artificial intelligence module can achieve intelligent monitoring and optimization of the time synchronization process, further reducing time errors and improving the accuracy and stability of time synchronization. Furthermore, because the AI module possesses self-learning and optimization capabilities, it can continuously adapt to changes in various complex environments and application scenarios, thereby ensuring that the electronic terminal 100 can achieve high-precision time synchronization in all situations. It is worth noting that the introduction of the AI module does not change the basic process and principles of time synchronization in the electronic terminal 100, but rather adds a layer of intelligent analysis and optimization mechanism on top of the existing process. Therefore, this design can further improve the accuracy and adaptability of time synchronization while maintaining the simplicity of the time synchronization process, providing more reliable time synchronization support for various high-precision application scenarios.
[0047] Optionally, in some embodiments, the control module 110 may be specifically an electronic control unit (ECU), and the communication module 120 may be specifically a central management unit (CMU).
[0048] This optional embodiment specifically illustrates the instantiation of the control module 110 and the communication module 120 within the electronic terminal 100. Specifically, in complex systems such as automotive electronics and industrial automation, the electronic control unit (ECU) serves as the core control component, responsible for receiving sensor signals, executing control algorithms, and outputting control instructions to achieve automated and intelligent control of the system. The central management unit (CMU) typically serves as a system-level management and communication center, responsible for data exchange and coordination between modules to ensure efficient overall system operation. Through its system-on-chip architecture and modular platform, the ECU effectively integrates the aforementioned control unit module 111, time management module 112, and artificial intelligence module, enabling precise time calibration and intelligent management of the electronic terminal 100. Furthermore, as a specific instantiation of the communication module 120, the CMU possesses powerful data processing and communication capabilities, enabling efficient satellite system time acquisition, internal time calibration, and data exchange with the control module 110. It also effectively integrates the aforementioned communication processing module 122 and satellite timing module 121, ensuring that the system maintains a high degree of time synchronization accuracy even in complex environments.
[0049] In this optional embodiment, the control module 110 is concretized as an electronic control unit, which can fully utilize the powerful control ability and algorithm processing ability of the electronic control unit to achieve accurate calibration and management of the time of the electronic terminal 100. At the same time, the communication module 120 is concretized as a central management unit, which can make use of the excellent data communication and coordination capabilities of the central management unit to ensure the smooth progress of data transmission and synchronization processes between the various time synchronization modules. Through this instantiation design, not only is the time synchronization function of the electronic terminal 100 more efficient and reliable, but the overall performance and intelligence level of the system are further improved. In actual applications, the combined use of the electronic control unit and the central management unit will enable the electronic terminal 100 to better adapt to the needs of various complex environments and application scenarios, and provide users with more accurate and reliable time synchronization services. In addition, the design also has good scalability and flexibility, and can be customized and optimized according to different application scenarios and needs to meet the personalized needs of different users.
[0050] In this optional embodiment, Figure 1 Examples and the above Figure 2 Based on the various optional embodiments, a specific time calibration mechanism of the electronic terminal 100 can be provided as follows: (1) Initialization of the satellite timing module 121. Specifically, the communication processing module 122 may send an initialization instruction to the satellite timing module 121 after power-on to start receiving satellite signals, so that the global positioning navigation satellite system can continuously send the satellite system time to the satellite timing module 121. The initialization instruction may be sent through a serial port, and the satellite system time may be the recommended positioning information (Recommended Minimum Specific GPS / TRANSIT Data, GPRMC) that specifically carries UTC (Universal Time Coordinated) data in the time data transmitted in the NEMA (National Marine Electronics Association) protocol format.
[0051] (2) The satellite timing module 121 obtains and outputs the standard time. Specifically, the satellite timing module 121 continuously receives the satellite system time from the global positioning navigation satellite system and forwards it to the communication processing module 122, and continuously outputs the second pulse signal to the communication processing module 122.
[0052] (3) The communication processing module 122 calibrates the time to obtain the standard time. Specifically, the communication processing module 122 receives the second pulse signal and the satellite system time from the satellite timing module 121, adds seconds to the satellite system time and temporarily stores it to obtain the temporary time. In response to receiving the second pulse signal, the temporary time is used as the standard time.
[0053] (4) The time management module 112 performs time synchronization calibration on the communication processing module 122. Specifically, the time management module 112 can send a read time instruction to the control unit module 111 via AT. After the control unit module 111 receives the read time instruction, it forwards it to the communication processing module 122 via the network time protocol or the precision time protocol. After receiving the read time instruction, the communication processing module 122 sends an instruction carrying the standard time to the control unit module 111, such as "+STNP=T0", which means that the current standard time is T0. After receiving the instruction, the control unit module 111 can learn the standard time. When the communication processing module 122 sends the standard time to the control unit module 111, it also sends an interrupt instruction to the time management module 112. For example, when the communication module 120 is a central management unit, a high-level rising edge pulse is output through the CMU_IRQ pin. After receiving the interrupt instruction, the time management unit will record the reception time T1 of the interrupt instruction as the reference time point for synchronization calibration. After receiving the standard time T0, the control unit module 111 forwards the standard time to the time management module 112. The time management module 112 calculates the time difference ΔT=T0-T1 and calibrates its own clock to ensure the time synchronization accuracy of the entire system.
[0054] This embodiment is based on the above-mentioned electronic terminal 100, and realizes the synchronous transmission and automatic calibration of standard time and interrupt instructions through the collaborative design of the communication module 120 and the control module 110. Specifically, the communication module 120 generates an interrupt instruction while obtaining the standard time, and sends the two to the control module 110 synchronously, so that the control module 110 can accurately record the time difference between the interrupt reception time and the standard time, thereby achieving high-precision time calibration, which not only simplifies the time calibration process, but also effectively reduces the influence of factors such as data transmission delay and protocol parsing time through synchronous transmission at the hardware level, significantly improving the time calibration accuracy, so that the electronic terminal 100 of this application can meet the microsecond-level high-precision scenario requirements, avoid the error accumulation of traditional solutions, and the process does not require manual intervention, solving the problem of complex calibration process and reliance on manual operation in the prior art, significantly improving the efficiency and reliability of time calibration, and fundamentally improving the time synchronization performance of the electronic terminal 100.
[0055] See Figure 3 , Figure 3 1 is a flow chart of an embodiment of a time calibration method provided by the present application. The time calibration method is applied to the electronic terminal 100 as described above, and specifically includes: Step 210 : Acquire the standard time and generate an interrupt instruction simultaneously through the communication module 120 , and send the interrupt instruction and the standard time to the control module 110 simultaneously.
[0056] Step 220: Record the interruption reception time of the interruption instruction through the control module 110, and calibrate the current terminal time based on the time difference between the interruption reception time and the standard time.
[0057] Optionally, in some embodiments, the time calibration method also includes: receiving the standard time issued by the communication module 120 through the control unit module 111, and forwarding the standard time to the time management module 112; receiving the interrupt instruction issued by the communication module 120 through the time management module 112, and recording the interrupt reception time of the interrupt instruction, and calibrating the current terminal time based on the time difference between the interrupt reception time and the standard time.
[0058] Optionally, in some embodiments, the time synchronization method also includes: sending a read time instruction to the communication module 120 through the control unit module 111 to instruct the communication module 120 to respond, and monitoring the standard time issued by the communication module 120; monitoring the interrupt instruction issued at the same time as the standard time through the time management module 112.
[0059] Optionally, in some embodiments, the time calibration method further includes: obtaining satellite system time from the global satellite navigation system through the satellite timing module 121, forwarding the satellite system time to the communication processing module 122, and sending a second pulse signal to the communication processing module 122; adding seconds to the satellite system time through the communication processing module 122 to temporarily store it to obtain a temporary storage time, and in response to receiving the second pulse signal, using the temporary storage time as the standard time.
[0060] Optionally, in some embodiments, the time calibration method further includes: sending the standard time to the control module 110 through the communication processing module 122 in response to receiving the read time instruction sent by the control module 110, and sending an interrupt instruction to the control module 110 at the same time, so that the control module 110 can calibrate the current terminal time.
[0061] Optionally, in some embodiments, the time synchronization method also includes: detecting the operating status of the satellite timing module 121 through the communication processing module 122, and restarting the satellite timing module 121 when the operating status is abnormal, and if a read time instruction is received from the control module 110 during the restart process, an invalid identification value is returned to the control module 110.
[0062] Optionally, in some embodiments, the time calibration method further includes: performing deviation adjustment on the current terminal time based on intelligent analysis by an artificial intelligence module.
[0063] For details on the above steps, please refer to Figure 4 , Figure 4This is a schematic diagram of the interaction flow of a specific embodiment of the time calibration method, which specifically embodies an efficient mechanism for accurate time calibration based on the collaborative work of various modules in the above-mentioned electronic terminal 100. The specific method steps include: (1) The communication processing module 122 sends an initialization instruction to the satellite timing module 121; (2) The satellite acquisition module continuously receives satellite system time from the global satellite navigation system; (3) The satellite acquisition module sends the satellite system time to the communication processing module 122; (4) The communication processing module 122 adds seconds to the received satellite system time and temporarily stores it; (5) The communication processing module 122 receives the pulse-per-second signal sent by the satellite acquisition module; (6) The communication processing module 122 uses the temporary storage time as the standard time; (7) The time management module 112 sends a time reading instruction to the control unit module 111; (8) The control unit module 111 forwards the read time instruction to the communication processing module 122; (9) The communication processing module 122 sends the standard time to the control unit module 111 and sends an interrupt instruction to the time management module 112; (10) The time management module 112 records the interrupt reception time when the interrupt instruction is received; (11) At the same time, the control unit module 111 forwards the standard time to the time management module 112; (12) After receiving the standard time, the time management module 112 calculates the time difference between the interrupt reception time and the standard time and calibrates the current terminal time.
[0064] The above method steps can be specifically referred to the description of the collaborative working principle and time synchronization mechanism of the communication module 120 and the control module 110 in the aforementioned electronic terminal 100. Since some embodiments of this method correspond to the embodiments of the above electronic terminal 100, for the introduction of the time synchronization method provided by the embodiment of the present invention, please refer to the detailed description of the embodiment of the above electronic terminal 100. The embodiment of the present invention will not be repeated here, and it has the same beneficial effects as the above electronic terminal 100.
[0065] See Figure 5 , Figure 5 It is a structural diagram of an embodiment of the storage medium provided by this application.
[0066] The storage medium 300 stores program data 310. When the program data 310 is executed by the processor, the following is achieved: Figures 3 and 4 The timing method described.
[0067] The program data 310 is stored in a storage medium 300 and includes a number of instructions for enabling a network device (such as a router, a personal computer, a server, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application.
[0068] Optionally, the storage medium 300 may be any medium capable of storing the program data 310, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0069] See Figure 6 , Figure 6 It is a structural diagram of an embodiment of the computer device provided by this application.
[0070] The computer device 400 includes a processor 420 and a memory 410 connected to each other. The memory 410 stores a computer program. When the processor 420 executes the computer program, the following is achieved: Figures 3 and 4 The memory 410 may include the storage medium 300 or may be other independently developed memory.
[0071] Different from the prior art, the present application discloses an electronic terminal, a time calibration method, a storage medium and a computer device. Through the collaborative design of the communication module and the control module, the synchronous transmission and automatic calibration of the standard time and the interrupt instruction are realized. Specifically, the communication module generates an interrupt instruction while obtaining the standard time, and sends the two to the control module synchronously, so that the control module can accurately record the time difference between the interrupt reception time and the standard time, thereby achieving high-precision time calibration, which not only simplifies the time calibration process, but also effectively reduces the influence of factors such as data transmission delay and protocol parsing time through synchronous transmission at the hardware level, significantly improving the time calibration accuracy, so that the electronic terminal of the present application can meet the microsecond-level high-precision scenario requirements, avoid the error accumulation of traditional solutions, and the process does not require manual intervention, which solves the problem of complex calibration process and reliance on manual operation in the prior art, significantly improves the efficiency and reliability of time calibration, and fundamentally improves the time synchronization performance of the electronic terminal.
[0072] The various embodiments in this specification are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the method embodiment, storage medium, and computer device embodiment are generally similar to the electronic terminal embodiment, so their descriptions are relatively simple. For relevant portions, refer to the description of the electronic terminal embodiment.
[0073] In the several embodiments provided in this application, it should be understood that the disclosed electronic terminal, time synchronization method, storage medium, and computer device can be implemented in other ways. For example, the electronic terminal embodiments described above are merely illustrative. For example, the division of modules and submodules is merely a logical functional division. In actual implementation, other division methods may be used, such as combining or integrating multiple modules or submodules into another system, or omitting or not implementing certain features.
[0074] The above are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An electronic terminal, characterized in that: The electronic terminal includes a control module and a communication module connected to each other; The communication module is used to simultaneously obtain the standard time and generate an interrupt instruction, and send the interrupt instruction and the standard time to the control module at the same time; The control module is used to record the interruption reception time when the interruption instruction is received, and calibrate the current terminal time based on the time difference between the interruption reception time and the standard time.
2. The electronic terminal according to claim 1, wherein: The control module includes a control unit module and a time management module connected to each other; The communication interface of the control unit module is used to connect to the communication module, receive the standard time sent by the communication module, and forward the standard time to the time management module; The interrupt interface of the time management module is used to connect to the communication module, receive the interrupt instruction issued by the communication module, record the interrupt reception time when the interrupt instruction is received, and calibrate the current terminal time based on the time difference between the interrupt reception time and the standard time.
3. The electronic terminal according to claim 2, characterized in that The control unit module is further configured to send a time reading instruction to the communication module to instruct the communication module to respond, and monitor the standard time sent by the communication module; The time management module is further configured to monitor the interruption instruction issued simultaneously with the standard time.
4. The electronic terminal according to claim 1, wherein: The communication module includes a satellite timing module and a communication processing module connected to each other; The satellite timing module is used to obtain satellite system time from the global satellite navigation system, forward the satellite system time to the communication processing module, and send a second pulse signal to the communication processing module; The communication processing module is used to add seconds to the satellite system time and temporarily store it to obtain temporary time, and in response to receiving the second pulse signal, use the temporary time as the standard time.
5. The electronic terminal according to claim 4, characterized in that: The communication processing module is further configured to send the standard time to the control module in response to receiving a read time instruction sent by the control module, and simultaneously send the interrupt instruction to the control module so that the control module can calibrate the current terminal time.
6. The electronic terminal according to claim 5, characterized in that: The communication processing module is also used to detect the operating status of the satellite timing module and restart the satellite timing module when the operating status is abnormal. If the read time instruction of the control module is received during the restart process, an invalid identification value is returned to the control module.
7. The electronic terminal according to claim 1, characterized in that: The control module and the communication module are connected via RS232, RS485 or a controller area network bus, and communicate via a network time protocol or a precision time protocol.
8. A time calibration method, applied to the electronic terminal according to any one of claims 1 to 7, characterized in that: include: Acquire the standard time and generate an interrupt instruction simultaneously through the communication module, and send the interrupt instruction and the standard time to the control module simultaneously; The control module records the interruption reception time of the interruption instruction, and calibrates the current terminal time based on the time difference between the interruption reception time and the standard time.
9. A storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the steps of the time calibration method according to claim 8 are implemented.
10. A computer device, characterized in that: The device comprises a processor and a memory connected to each other, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the time calibration method according to claim 8 are implemented.