T-box device based on multiple time sources, time data acquisition method and vehicle terminal
By employing a multi-time-source T-Box device and microcontroller evaluation method, the problem of timestamp accuracy in vehicle T-Box devices during SOC module failure was solved, achieving reliable and accurate time synchronization.
Patent Information
- Application Number
- CN202511196734.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-08-26
AI Technical Summary
In intelligent connected vehicles, when the vehicle's T-Box device fails to function properly, the method of recording time using a single time source is unreliable, resulting in insufficient timestamp accuracy, which may lead to misjudgment or functional failure.
A T-Box device based on multiple time sources is used to acquire time data through an initial time source and multiple intermediate time sources. A microcontroller is used to evaluate the confidence level and select a reliable target time source to determine the current time data.
This improves the accuracy of vehicle timestamps, effectively avoids the reliability issues associated with recording time from a single time source, and ensures the reliability and accuracy of time synchronization.
Smart Images

Figure CN120730461B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of time calibration technology, and in particular to a T-Box device based on multiple time sources, a time data acquisition method, and a vehicle terminal. Background Technology
[0002] In the field of intelligent connected vehicles, time synchronization technology of in-vehicle terminals is the core foundation for ensuring the reliability of vehicle functions and the accuracy of data. According to national standards, in-vehicle terminals must provide time accurate to the second and date accurate to the day, and the time error must be controlled within ±5 seconds within 24 hours. To ensure time accuracy, the vehicle's T-Box (Telematics Box) device achieves time synchronization through GPS (Global Positioning System) or NTP (Network Time Protocol). Specifically, it uses NMEA (National Marine Electronics Association) protocol messages based on GPS. When the device is successfully located, the time field information in the NMEA message is considered reliable time. Alternatively, the time can be obtained from a time synchronization server via the NTP protocol. If the request receives a positive response, the server time is confirmed as reliable time.
[0003] However, both GPS and NTP rely on the continuous and stable operation of the SOC (System on Chip) within the T-Box device. When the SOC module malfunctions due to extreme conditions such as sleep mode, network outage, hardware failure, or electromagnetic interference, the time synchronization mechanism will fail. For example, when a vehicle enters deep sleep mode, the SOC may shut down some communication modules to reduce power consumption, leading to GPS signal interruption or NTP server disconnection. In this situation, the T-Box cannot obtain a reliable time and can only rely on the local crystal oscillator to maintain time recording. However, due to the inherent frequency drift of the crystal oscillator, the time error within 24 hours may exceed the national standard's allowable range. Therefore, when the SOC module is not functioning properly, the method of recording time using a single time source is unreliable, which may lead to the vehicle's inability to guarantee the accuracy of the timestamp in critical scenarios, potentially causing misjudgments or functional failures. Summary of the Invention
[0004] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0005] In view of the shortcomings of the prior art described above, this application provides a T-Box device based on multiple time sources, a time data acquisition method, and a vehicle terminal to ensure the reliability of vehicle time data and improve the accuracy of vehicle timestamps.
[0006] This application provides a T-Box device based on multiple time sources, including: an initial time source for acquiring initial time data; multiple intermediate time sources for timing based on the initial time data to obtain time source data; and a microcontroller for evaluating the confidence of each intermediate time source based on the data difference between the time source data, determining a target time source from the intermediate time sources based on the confidence evaluation result, and determining the current time data based on the time source data output by the target time source.
[0007] In one embodiment of this application, if the initial time source includes a system-on-a-chip (SoC), the SoC obtains initial time data through at least one of the following methods: if the SoC is connected to a positioning server, it obtains a positioning protocol message from the positioning server, performs data verification on the positioning protocol message according to a preset positioning data verification strategy, and if the positioning protocol message passes the data verification, it extracts initial time data from the positioning protocol message, wherein the positioning data verification strategy includes at least one of positioning status verification, data integrity verification, and time reasonableness verification; if the SoC is connected to a network server, it obtains a network protocol message from the network server, performs data verification on the network protocol message according to a preset network data verification strategy, and if the network protocol message passes the data verification, it extracts initial time data from the network protocol message, wherein the network data verification strategy includes at least one of response validity verification, timestamp integrity verification, and clock offset verification.
[0008] In one embodiment of this application, the intermediate time source includes: a first time source disposed on the microcontroller, wherein the first time source is used to synchronize first timing data according to the initial time data, and to start timing with the synchronized first timing data as the timing start point to obtain first time source data; a second time source connected to the microcontroller, wherein the second time source is used to synchronize second timing data according to the initial time data, and to start timing with the synchronized second timing data as the timing start point to obtain second time source data; and a third time source connected to the microcontroller, wherein the third time source is used to, if it receives the initial time data, to count according to a preset counting period with a preset initial value as the counting start point to obtain a counter value, wherein the counter value is used to calculate the initial time data and the counting period to obtain third time source data.
[0009] In one embodiment of this application, the microcontroller determines the target time source by: comparing each of the data differences with a first preset threshold; designating any intermediate time source as a fourth time source, designating any intermediate time source other than the fourth time source as a fifth time source, designating the time source data corresponding to the fourth time source as first comparison data, and designating the time source data corresponding to the fifth time source as second comparison data; if the data differences corresponding to the first comparison data and each of the second comparison data are both greater than or equal to the first preset threshold, and the data differences between each of the second comparison data are less than the first preset threshold, then the confidence assessment result corresponding to the fourth time source is set to a negative state; if the data differences between each of the time source data are both greater than or equal to the first preset threshold, then the confidence assessment result corresponding to each of the intermediate time sources is set to a negative state; if the confidence assessment result corresponding to the intermediate time source is not a negative state, then the intermediate time source is determined as the target time source.
[0010] In one embodiment of this application, the microcontroller is further configured to: obtain the update period corresponding to the target time source; and periodically update the target time source according to the update period.
[0011] In one embodiment of this application, the microcontroller obtains the update period corresponding to the target time source by: comparing each of the data differences with a second preset threshold; if the data difference is greater than or equal to the second preset threshold, then the data difference is determined as an abnormal difference; calculating the preset period based on the number of abnormal differences to obtain the update period corresponding to the target time source, wherein the number of abnormal differences is negatively correlated with the update period.
[0012] In one embodiment of this application, before determining the current time data based on the time source data output by the target time source, the microcontroller is further configured to: obtain the time source state corresponding to the initial time source; if the time source state is a normal state, determine the current time data based on the initial time data output by the initial time source; if the time source state is an abnormal state, determine the current time data based on the time source data output by the target time source.
[0013] In one embodiment of this application, determining the current time data based on the time source data output by the target time source includes at least one of the following: if there is only one target time source, the time source data output by the target time source is determined as the current time data; if there are multiple target time sources, a current time source is determined from each of the target time sources according to a preset priority, so that the time source data output by the current time source is determined as the current time data; if there are multiple target time sources, and the data difference between each target time source is less than a preset fusion threshold, calculation is performed based on the time source data output by each target time source, and the calculation result is determined as the current time data.
[0014] This application also provides a time data acquisition method based on multiple time sources, applied to a T-Box device. The method includes: acquiring initial time data through an initial time source; obtaining time source data by timing based on the initial time data through multiple intermediate time sources; evaluating the confidence of each intermediate time source based on the data difference between each time source data using a microcontroller, determining a target time source from each intermediate time source based on the confidence evaluation result, and determining the current time data based on the time source data output by the target time source.
[0015] This application also provides a vehicle terminal, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the vehicle terminal performs the above-described method.
[0016] The beneficial effects of this application are:
[0017] Initial time data is acquired from an initial time source, and multiple intermediate time sources are used to generate their own time source data based on this initial time data. A microcontroller then evaluates the confidence of these intermediate time sources based on the differences between their outputs, and determines a target time source from among them based on the evaluation results. The current time data is then determined based on the time source data output from the target time source. In this way, by using multiple intermediate time sources to independently time based on the initial time data and combining the differences between the time source data to select a reliable target time source, the reliability issues that may occur when recording time from a single time source are effectively avoided, thus improving the accuracy of vehicle timestamps. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0019] In the attached diagram:
[0020] Figure 1 This is a schematic diagram of the structure of a T-Box device based on multiple time sources in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of another T-Box device based on multiple time sources in an embodiment of this application;
[0022] Figure 3 This is a flowchart illustrating a method for determining a target time source in an embodiment of this application;
[0023] Figure 4 This is a flowchart illustrating a time data acquisition method based on multiple time sources in an embodiment of this application.
[0024] Figure 5 This is a schematic diagram of the structure of another vehicle terminal in an embodiment of this application. Detailed Implementation
[0025] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0027] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.
[0028] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0029] Unless otherwise stated, the term "multiple" means two or more.
[0030] In this application, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.
[0031] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.
[0032] Combination Figure 1 As shown, this application provides a T-Box device based on multiple time sources, including an initial time source 101, multiple intermediate time sources 102, and a microcontroller 103.
[0033] Initial time source 101 is used to obtain initial time data.
[0034] The intermediate time source 102 is used to perform timing based on the initial time data to obtain time source data.
[0035] The microcontroller 103 is used to evaluate the confidence of each intermediate time source based on the data difference between each time source data, to determine the target time source from each intermediate time source based on the confidence evaluation result, and to determine the current time data based on the time source data output by the target time source.
[0036] The T-Box device based on multiple time sources provided in this application acquires initial time data from an initial time source, and generates its own time source data by using multiple intermediate time sources based on this initial time data. A microcontroller then evaluates the confidence of these intermediate time sources based on the differences between their outputs, and determines a target time source from among them based on the evaluation results. The current time data is then determined based on the time source data output by the target time source. In this way, by using multiple intermediate time sources to independently time based on the initial time data and combining the differences between the time source data to filter out a reliable target time source, the reliability issues that may occur when recording time from a single time source are effectively avoided, thereby improving the accuracy of vehicle timestamps.
[0037] Combination Figure 2As shown, this application provides a T-Box device based on multiple time sources, including an initial time source 101, an intermediate time source 102, and a microcontroller unit / motor control unit (MCU).
[0038] In some embodiments, the time source component generates a stable time reference through physical phenomena or technical means. Both the initial time source and the intermediate time source belong to the time source component, providing accurate time information. The time source component includes, but is not limited to, atomic clocks, time timers, satellite time sources, network time sources, optical lattice clocks, etc.
[0039] In some embodiments, the core components of an atomic clock include a cesium atom beam tube, an optical pumping system, a microwave cavity, etc. It uses the frequency of electromagnetic waves released when atoms transition between specific energy levels as a reference, and ensures the long-term accuracy of time data through the stability of atomic resonance frequencies.
[0040] In some embodiments, the core of the timer is a piezoelectric quartz crystal and an oscillation circuit. The high-frequency oscillation generated by the quartz crystal under the action of an electric field is converted into second pulses by a frequency divider circuit, which drive a stepper motor to perform timing and obtain time data.
[0041] In some embodiments, the core of a satellite time source is an onboard atomic clock and a global satellite network. A satellite carrying a high-precision atomic clock sends a signal containing a timestamp to the ground. The satellite time source receives the satellite signal via electromagnetic wave transmission, extracts the timestamp, and obtains the time data.
[0042] In some embodiments, the core of the network time source lies in the protocol algorithm and time synchronization mechanism, which uses time-related servers to collect time data. For example, NTP (Network Time Protocol) uses the client to exchange timestamp messages with the server, calculates the transmission delay and calibrates the local time. Alternatively, PTP (Precise Time Protocol) uses hardware timestamps and link delay compensation to achieve time data synchronization.
[0043] In some embodiments, the optical lattice clock uses laser cooling technology to trap strontium atoms in an optical lattice, and generates a time reference by detecting the optical frequency transition frequency to achieve timekeeping.
[0044] The initial time source 101 includes a system-on-a-chip (SOC), wherein the SOC includes an antenna unit and a first processing module.
[0045] Antenna unit, used to receive positioning protocol messages and / or network protocol messages.
[0046] Optionally, the initial time data is obtained in the following way: if the on-chip system is connected to a positioning server, the positioning protocol message is obtained from the positioning server, and the positioning protocol message is verified according to a preset positioning data verification strategy. If the positioning protocol message passes the data verification, the initial time data is extracted from the positioning protocol message. The positioning data verification strategy includes at least one of positioning status verification, data integrity verification, and time reasonableness verification.
[0047] In some embodiments, the positioning server includes one or more of GPS, BeiDou satellites, etc., and the positioning protocol message includes NMEA protocol message, etc.
[0048] In some embodiments, the first processing module is used to: perform data verification on the positioning protocol message, wherein the positioning status verification includes verifying the positioning status bit of the GPRMC (General Positioning System Recommended Minimum Specific GPS / Transit Data) field in the positioning protocol message; the data integrity verification includes verifying the positioning protocol message using a checksum algorithm to verify that the positioning protocol message has not been tampered with and that no transmission errors have occurred; and the time reasonableness verification includes checking whether the time field format is within the valid range and eliminating garbled characters caused by signal loss.
[0049] Optionally, the initial time data is obtained in the following way: if the system on the chip is connected to a network server, the network protocol message is obtained from the network server, the network protocol message is verified according to a preset network data verification strategy, and if the network protocol message passes the data verification, the initial time data is extracted from the network protocol message. The network data verification strategy includes at least one of response validity verification, timestamp integrity verification, and clock offset verification.
[0050] In some embodiments, network protocol messages include one or more of the following: 2G (Second Generation) network messages, 3G (Third Generation) network messages, 4G (Fourth Generation) network messages, 5G (Fifth Generation) network messages, and wireless network messages.
[0051] In some embodiments, the first processing module is used to: perform data verification on network protocol messages, wherein the response validity verification includes requiring the Stratum level (time level) in the NTP response packet to be less than or equal to a preset level threshold, the timestamp integrity verification includes the client sending time T1 being less than the server return time T4, and the clock offset verification includes the time offset Offset=[(T2-T1)+(T3-T4)] / 2 being less than a preset time offset threshold.
[0052] In some embodiments, the first processing module is used to: send initial time data to the microcontroller 103 through a preset communication protocol. For example, the initial time data adopts the UTC (Coordinated Universal Time) time format, and the preset communication protocol includes the UART (Universal Asynchronous Receiver / Transmitter) protocol.
[0053] Optionally, before determining the current time data based on the time source data output by the target time source, the microcontroller is further configured to: obtain the time source state corresponding to the initial time source; if the time source state is normal, determine the current time data based on the initial time data output by the initial time source; if the time source state is abnormal, determine the current time data based on the time source data output by the target time source.
[0054] In some embodiments, if the initial time source can obtain the initial time data, the current time data is determined based on the initial time data; if the vehicle terminal is in an environment with poor network conditions, such as an underground parking lot, or if the SOC in the T-Box is in sleep mode and the SOC cannot obtain the initial time data for time calibration, the current time data is determined based on the time source data output by the target time source, according to the trusted source list formed by the target time source, and time calibration is achieved.
[0055] Intermediate time source 102 includes a first time source, a second time source, and a third time source.
[0056] The first time source is set in the microcontroller. The first time source is used to synchronize the first timing data according to the initial time data, and to start timing with the synchronized first timing data as the timing start point to obtain the first time source data.
[0057] In some embodiments, the first time source includes the MCU RTC (Real-Time Clock) timer in the microcontroller 103, wherein the microcontroller 103 writes the received initial time data into the register of the MCU RTC timer in seconds format to obtain the first timing data, and starts timing from the first timing data through the MCU RTC timer.
[0058] The second time source is connected to the microcontroller. The second time source is used to synchronize the second timing data according to the initial time data, and uses the synchronized second timing data as the timing start point to obtain the second time source data.
[0059] In some embodiments, the second time source includes a temperature-compensated RTC timer, which is externally located on the microcontroller 103 and connected to the microcontroller 103. The microcontroller 103 writes the received initial time data into the register of the temperature-compensated RTC timer in seconds format to obtain second timing data, and starts timing from the second timing data through the temperature-compensated RTC timer.
[0060] The third time source is connected to the microcontroller. If the initial time data is received, the third time source uses a preset initial value as the starting point for counting and counts according to a preset counting period to obtain a counter value. The counter value is used to calculate the initial time data and the counting period to obtain the third time source data.
[0061] In some embodiments, the third time source includes a high-resolution timer set based on a master clock oscillator, wherein the master clock oscillator is external to the microcontroller 103 and connected to the microcontroller 103; after the microcontroller 103 acquires the initial time data, it triggers the timer so that the timer starts counting from a preset initial value of 0 to obtain a counter value. This counter value does not represent the time data, but only records the time interval experienced since the last acquisition of the initial time data. The microcontroller 103 is also used to record the initial time data acquired each time.
[0062] In some embodiments, the time source data corresponding to the third time source ,in, The initial time data for the last record. The counter value output by the third time source. The counting frequency is the third time source.
[0063] The microcontroller 103 includes a first time source, a second processing unit and a CAN communication unit, and the microcontroller 103 is connected to the second time source and the third time source.
[0064] In some embodiments, the second processing unit is used to periodically update the target time source and determine the current time data based on the time source data output by the target time source.
[0065] In some embodiments, the CAN communication unit is connected to the user side of the vehicle terminal. The CAN (Controller Area Network) communication unit is used to upload the current time data to the user side for user use.
[0066] Optionally, the microcontroller is used to: obtain the update period corresponding to the target time source; and periodically update the target time source according to the update period.
[0067] In some embodiments, the local timing verification of the T-Box typically uses the acquisition of initial time data as a trigger condition. However, this application uses multiple intermediate time sources to calibrate the time record inside the vehicle terminal. Compared to using the acquisition of initial time data as a trigger condition, the target time source is periodically updated through an update cycle to keep the calibration process of the intermediate time source constant. The update cycle ranges from 10 seconds to 300 seconds, for example, the update cycle is set to 60 seconds.
[0068] Optionally, the microcontroller obtains the update period corresponding to the target time source by comparing each data difference with a second preset threshold; if the data difference is greater than or equal to the second preset threshold, the data difference is determined as an abnormal difference; the preset period is calculated based on the number of abnormal differences to obtain the update period corresponding to the target time source, wherein the number of abnormal differences is negatively correlated with the update period.
[0069] In some embodiments, by converting the physical layer clock error into a computable digital signal, software strategies are used to compensate for hardware defects. Based on the quantization of data difference anomalies, dynamic parameter tuning of the update cycle is achieved through negative correlation. This allows time source calibration to be demand-responsive, meeting national standard accuracy requirements while optimizing power consumption and reliability. Specifically, the more abnormal differences there are, the shorter the update cycle. The formula for calculating the update cycle is... ,in, For the final update cycle, For the initial update cycle, To preset the empirical coefficient, This represents the number of outlier values.
[0070] In some embodiments, if there are two intermediate time sources, a first preset threshold is compared based on the data difference between the time source data; if the data difference is greater than or equal to the first preset threshold, the confidence evaluation results of the intermediate time sources are set to a negative state respectively; if the data difference is less than the first preset threshold, the two intermediate time sources are determined as target time sources respectively.
[0071] Optionally, if the number of intermediate time sources is three or more, the microcontroller determines the target time source in the following manner: It compares each data difference with a first preset threshold; it designates any intermediate time source as a fourth time source, and any intermediate time source other than the fourth time source as a fifth time source; it uses the time source data corresponding to the fourth time source as first comparison data, and the time source data corresponding to the fifth time source as second comparison data; if the data differences corresponding to the first comparison data and each of the second comparison data are both greater than or equal to the first preset threshold, and the data differences between each of the second comparison data are less than the first preset threshold, then the confidence assessment result corresponding to the fourth time source is set to a negative state; if the data differences between each time source data are both greater than or equal to the first preset threshold, then the confidence assessment result corresponding to each intermediate time source is set to a negative state; if the confidence assessment result corresponding to the intermediate time source is not a negative state, then the intermediate time source is determined as the target time source.
[0072] In some embodiments, the time source data corresponding to the first time source is denoted as... The time source data corresponding to the second time source is denoted as The time source data corresponding to the third time source is denoted as The data difference between the first time source and the second time source The data difference between the first time source and the third time source The data difference between the second and third time sources ,in, It is the absolute value symbol.
[0073] In some embodiments, if data difference Greater than or equal to the first preset threshold, and the data difference Greater than or equal to the first preset threshold, and the data difference If the result is less than the first preset threshold, the confidence assessment result of the first time source is negative.
[0074] In some embodiments, if data difference Greater than or equal to the first preset threshold, and the data difference Less than the first preset threshold, and the data difference If the confidence level of the second time source is greater than or equal to the first preset threshold, then the confidence level assessment result of the second time source is negative.
[0075] In some embodiments, if data difference Less than the first preset threshold, and the data difference Greater than or equal to the first preset threshold, and the data difference If the confidence assessment result of the third time source is greater than or equal to the first preset threshold, then the confidence assessment result of the third time source is negative.
[0076] In some embodiments, if data difference Greater than or equal to the first preset threshold, and the data difference Greater than or equal to the first preset threshold, and the data difference If the confidence level is greater than or equal to the first preset threshold, then the confidence level assessment results for each intermediate time source will be negative.
[0077] In some embodiments, if the confidence assessment results of each intermediate time source are all negative, anomaly handling is performed, wherein anomaly handling includes restoring each intermediate data source, using the initial time data of the last record, generating a fault code, etc.
[0078] Combination Figure 3 As shown, this application provides a method for determining a target time source, including:
[0079] Step S301: Obtain the time source data corresponding to each target time source;
[0080] Step S302: Calculate the data difference between each time source data;
[0081] Step S303: Each target time source is determined as the fourth time source;
[0082] Among them, the intermediate time source other than the fourth time source is used as the fifth time source, the time source data corresponding to the fourth time source is used as the first comparison data, and the time source data corresponding to the fifth time source is used as the second comparison data.
[0083] Step S304: Determine whether the differences of each data corresponding to the first comparison data are all greater than or equal to the first preset threshold. If yes, proceed to step S305; otherwise, proceed to step S306.
[0084] Step S305: Determine whether the data difference between the second comparison data is greater than or equal to the first preset threshold. If yes, proceed to step S307; otherwise, proceed to step S308.
[0085] Step S306: Set the fourth time source as the target time source.
[0086] Step S307: Each intermediate time source is identified as an abnormal time source.
[0087] Step S308: The fourth time source is identified as an abnormal time source.
[0088] Optionally, determining the current time data based on the time source data output by the target time source includes at least one of the following: if there is only one target time source, then the time source data output by the target time source is determined as the current time data; if there are multiple target time sources, then a current time source is determined from each target time source according to a preset priority, so that the time source data output by the current time source is determined as the current time data; if there are multiple target time sources, and the data difference between each target time source is less than a preset fusion threshold, then calculation is performed based on the time source data output by each target time source, and the calculation result is determined as the current time data.
[0089] In some embodiments, the current time source is determined according to priority, and the time source data output by the current time source is determined as the current time data. For example, if the target time source includes a second time source, the second time source is used as the current time source, and the current time data is determined based on the time source data output by the second time source.
[0090] In some embodiments, if there are multiple target data sources and the data difference between the target data sources is less than a preset fusion threshold, the time source data output by each target data source is calculated using an average method or a weighted calculation method to obtain the current time data.
[0091] In some embodiments, if the time source data output by the target data source are 2025-08-20 13:15:25, 2025-08-20 13:15:26, and 2025-08-20 13:15:27, then taking 0:00 on 2025-08-20 as the starting point, each time source data is converted into seconds, i.e., 2025-08-20 13:15:25 is 47725 seconds, 2025-08-20 13:15:26 is 47726 seconds, and 2025-08-20 13:15:26 is 47727 seconds. Using an averaging method, the average of 47725 seconds, 47726 seconds, and 47727 seconds is calculated to obtain 47726 seconds. This 47726 seconds is then converted to UTC time data, resulting in the current time data as 2025-08-20. 13:15:26.
[0092] In some embodiments, if the time source data output by the target data source are 2025-08-20 13:15:25, 2025-08-20 13:15:26, and 2025-08-20 13:15:27, then taking 0:00 on 2025-08-20 as the starting point, each time source data is converted into seconds. That is, 2025-08-20 13:15:25 is 47725 seconds, 2025-08-20 13:15:26 is 47726 seconds, and 2025-08-20... 13:15:26 is 47727 seconds; the weights of 47725 seconds, 47726 seconds, and 47727 seconds are 0.4 / 0.4 / 0.2 respectively. A weighted average of these weights is then calculated to obtain 47725.8 seconds. This 47725.8 seconds is then rounded and converted to UTC time data, resulting in the current time data 2025-08-20 13:15:26.
[0093] Combination Figure 4 As shown, this application provides a time data acquisition method based on multiple time sources, applied to a T-Box device. The method includes:
[0094] Step S401: Obtain initial time data through the initial time source;
[0095] Step S402: Time source data is obtained by timing based on the initial time data through multiple intermediate time sources;
[0096] Step S403: The microcontroller evaluates the confidence of each intermediate time source based on the data difference between each time source data, determines the target time source from each intermediate time source based on the confidence evaluation result, and determines the current time data based on the time source data output by the target time source.
[0097] The time data acquisition method based on multiple time sources provided in this application acquires initial time data from an initial time source. Multiple intermediate time sources then use this initial time data to generate their own time source data. A microcontroller evaluates the confidence of these intermediate time sources based on the differences between their outputs, and determines a target time source from among them based on the evaluation results. The current time data is then determined based on the time source data output from the target time source. In this way, by independently timing based on initial time data from multiple intermediate time sources and filtering out a reliable target time source by combining the differences between their data, the reliability issues that may arise when recording time from a single time source are effectively avoided, thereby improving the accuracy of vehicle timestamps.
[0098] This application also provides a vehicle terminal, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the vehicle terminal performs the above-described method.
[0099] Figure 5 A schematic diagram of a computer system suitable for implementing the vehicle terminal embodiments of this application is shown. It should be noted that... Figure 5 The computer system 500 of the vehicle terminal shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0100] like Figure 5 As shown, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on programs stored in Read-Only Memory (ROM) 502 or programs loaded from storage portion 508 into Random Access Memory (RAM) 503. The RAM 503 also stores various programs and data required for system operation. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An Input / Output (I / O) interface 505 is also connected to the bus 504.
[0101] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. Removable media 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 510 as needed so that computer programs read from them can be installed into storage section 508 as needed.
[0102] The vehicle terminal disclosed in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the vehicle terminal performs the various steps of the above method.
[0103] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated subsamples, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other subsamples, wholes, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes the element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0104] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0105] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some sub-samples may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. Furthermore, the functional units in this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0106] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of the systems, methods, and computer program products according to this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than those disclosed in the description; sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A T-Box device based on multiple time sources, characterized in that, include: Initial time source, used to obtain initial time data; Multiple intermediate time sources are used to perform timing based on the initial time data to obtain time source data; A microcontroller is configured to evaluate the confidence of each intermediate time source based on the data difference between each time source data, determine a target time source from each intermediate time source based on the confidence evaluation result, and determine the current time data based on the time source data output by the target time source. The microcontroller determines the target time source by comparing each data difference with a first preset threshold; designating any intermediate time source as a fourth time source, and any intermediate time source other than the fourth time source as a fifth time source; using the time source data corresponding to the fourth time source as first comparison data, and the time source data corresponding to the fifth time source as second comparison data; if the data differences corresponding to the first comparison data and each of the second comparison data are both greater than or equal to the first preset threshold, and the data differences between each of the second comparison data are less than the first preset threshold, then the confidence assessment result corresponding to the fourth time source is set to a negative state; if the data differences between each of the time source data are both greater than or equal to the first preset threshold, then the confidence assessment results corresponding to each of the intermediate time sources are set to a negative state; if the confidence assessment result corresponding to the intermediate time source is not a negative state, then the intermediate time source is determined as the target time source.
2. The T-Box device according to claim 1, characterized in that, If the initial time source includes an on-chip system, the on-chip system acquires the initial time data through at least one of the following methods: If the on-chip system is connected to a positioning server, it obtains positioning protocol messages from the positioning server, performs data verification on the positioning protocol messages according to a preset positioning data verification strategy, and if the positioning protocol messages pass the data verification, it extracts initial time data from the positioning protocol messages. The positioning data verification strategy includes at least one of positioning status verification, data integrity verification, and time reasonableness verification. If the system-on-a-chip is connected to a network server, it obtains network protocol messages from the network server, performs data verification on the network protocol messages according to a preset network data verification strategy, and if the network protocol messages pass the data verification, it extracts initial time data from the network protocol messages. The network data verification strategy includes at least one of response validity verification, timestamp integrity verification, and clock offset verification.
3. The T-Box device according to claim 1, characterized in that, The intermediate time source includes: A first time source is set in the microcontroller, wherein the first time source is used to synchronize the first timing data according to the initial time data, and to use the synchronized first timing data as the timing start point to obtain the first time source data; A second time source is connected to the microcontroller. The second time source is used to synchronize the second timing data according to the initial time data, and to use the synchronized second timing data as the timing start point to obtain the second time source data. A third time source is connected to the microcontroller. The third time source is used to count according to a preset counting period, starting from a preset initial value, if the initial time data is received, to obtain a counter value. The counter value is used to calculate the initial time data and the counting period to obtain the third time source data.
4. The T-Box device according to claim 1, characterized in that, The microcontroller is also used for: Obtain the update period corresponding to the target time source; The target time source is periodically updated according to the stated update cycle.
5. The T-Box device according to claim 4, characterized in that, The microcontroller obtains the update period corresponding to the target time source in the following manner: The second preset threshold is compared based on the differences in each of the data; If the data difference is greater than or equal to the second preset threshold, the data difference is determined to be an abnormal difference. The update period corresponding to the target time source is obtained by calculating the preset period based on the number of abnormal differences, wherein the number of abnormal differences is negatively correlated with the update period.
6. The T-Box device according to any one of claims 1 to 5, characterized in that, Before determining the current time data based on the time source data output from the target time source, the microcontroller is also configured to: Obtain the time source state corresponding to the initial time source; If the time source is in a normal state, the current time data is determined based on the initial time data output by the initial time source. If the time source status is abnormal, the current time data is determined based on the time source data output by the target time source.
7. The T-Box device according to any one of claims 1 to 5, characterized in that, The current time data is determined based on the time source data output by the target time source, including at least one of the following: If there is only one target time source, then the time source data output by the target time source is determined as the current time data; If there are multiple target time sources, a current time source is determined from each target time source according to a preset priority, so that the time source data output by the current time source is determined as the current time data; If there are multiple target time sources, and the data difference between each target time source is less than a preset fusion threshold, then the calculation is performed based on the time source data output by each target time source, and the calculation result is determined as the current time data.
8. A method for acquiring time data based on multiple time sources, characterized in that, Applied to T-Box devices, the method includes: Obtain initial time data from the initial time source; Time source data is obtained by timing based on initial time data through multiple intermediate time sources; The microcontroller evaluates the confidence of each intermediate time source based on the data difference between each time source data, determines the target time source from each intermediate time source based on the confidence evaluation result, and determines the current time data based on the time source data output by the target time source. The target time source is determined as follows: A first preset threshold is compared based on the differences between the data sources. Any intermediate time source is designated as the fourth time source, and any intermediate time source other than the fourth time source is designated as the fifth time source. The time source data corresponding to the fourth time source is used as the first comparison data, and the time source data corresponding to the fifth time source is used as the second comparison data. If the data differences between the first comparison data and each of the second comparison data are both greater than or equal to the first preset threshold, and the data differences between each of the second comparison data are less than the first preset threshold, then the confidence assessment result corresponding to the fourth time source is set to a negative state. If the data differences between each of the time source data are both greater than or equal to the first preset threshold, then the confidence assessment results corresponding to each of the intermediate time sources are set to a negative state. If the confidence assessment result corresponding to the intermediate time source is not a negative state, then the intermediate time source is determined as the target time source.
9. A vehicle terminal, characterized in that, include: Processor and memory; The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to cause the vehicle terminal to perform the method as described in claim 8.
Citation Information
Patent Citations
Vehicle-mounted T-BOX time synchronization method, electronic equipment and storage medium
CN119676277A
Time synchronization device for providing timing information acquired from network time sources to endpoint devices
US20230393608A1