A time synchronization method and vehicle-mounted equipment

By sending requests to multiple time sources in the on-board device and selecting the most accurate time source for synchronization, the time error problem caused by a single time source failure is solved, and the accuracy of the on-board device time is improved.

CN114826463BActive Publication Date: 2025-05-13HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110121200.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-28
Publication Date
2025-05-13
Estimated Expiration
2041-01-28

AI Technical Summary

Technical Problem

The time synchronization of on-board equipment relies on a single time source, which causes the on-board equipment to fail to obtain the correct time when the time source fails or is abnormal, affecting its function.

Method used

When starting the vehicle, the on-board device sends a time synchronization request message to at least two time sources, receives and compares the time responses of each time source, determines the most accurate time source as the target time source, and performs time synchronization.

Benefits of technology

Selecting the most accurate time source through multiple time sources for synchronization improves the accuracy of obtaining time on-board equipment and avoids time error problems caused by failure of a single time source.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114826463B_ABST
    Figure CN114826463B_ABST
Patent Text Reader

Abstract

A time synchronization method and vehicle-mounted device, the method comprising: the vehicle-mounted device receives a first operation, the first operation is used to start the vehicle where the vehicle-mounted device is located; the vehicle-mounted device responds to the first operation and sends a time synchronization request message to at least two time sources; the vehicle-mounted device receives a time synchronization response message, the time synchronization response message includes the time sent by each time source; the vehicle-mounted device determines the most accurate time source among at least two time sources according to the time sent by each time source; the vehicle-mounted device performs time synchronization according to the time of the most accurate time source. Through the method of the present application, the time of the vehicle-mounted device can obtain time from multiple time sources, that is, it does not rely on a single time source, and the time source with the highest credibility can be selected from multiple time sources, so that when the current time is not accurate enough, it can switch to the most credible time source to ensure the normal use of the vehicle-mounted device function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Internet of Vehicles, and in particular to a time synchronization method and vehicle-mounted equipment. Background Art

[0002] With the development of Internet of Things technology and the automobile industry, vehicle-mounted devices are increasingly used in various vehicles, and the time credibility of vehicle-mounted devices has a great impact on vehicle-mounted devices.

[0003] The vehicle-mounted device usually synchronizes the time in the following way: the vehicle-mounted device sends a time synchronization request message to the server. After receiving the time synchronization request message, the server can feedback a time synchronization response message to the vehicle-mounted device, and the synchronization response message can include the server time. Then, the vehicle-mounted device updates the local time of the vehicle-mounted device according to the server time.

[0004] In other words, the time of the vehicle-mounted device depends on a single time source. When the single time source (server) fails or is abnormal, the vehicle-mounted device will not be able to obtain the correct time, which will affect the function of the vehicle-mounted device. Summary of the invention

[0005] The present application provides a time synchronization method and an in-vehicle device, which are used to improve the accuracy of the time of the in-vehicle device and avoid the problem of not being able to obtain the correct time when a single time source fails or is abnormal.

[0006] In the first aspect, the present application provides a time synchronization method, which can be applied to an in-vehicle device. The method includes: the in-vehicle device receives a first operation, the first operation is used to start the vehicle where the in-vehicle device is located; the in-vehicle device responds to the first operation and sends a time synchronization request message to at least two time sources; the in-vehicle device receives a time synchronization response message sent by each of the at least two time sources, the time synchronization response message includes the time sent by each time source; the in-vehicle device determines a target time source from the at least two time sources according to the time sent by each of the at least two time sources, the target time source is the time source with the most accurate time among the at least two time sources; the in-vehicle device performs time synchronization according to the time of the target time source.

[0007] Through the above technical solution, the vehicle-mounted device can send a time synchronization request message to multiple time sources when the vehicle is triggered to start, and then select the time source with the highest credibility (or the most accurate time) from multiple time sources according to the time fed back by the multiple time sources, that is, the target time source, and finally synchronize the time of the vehicle-mounted device according to the time of the target time source. In this way, the time of the vehicle-mounted device can be derived from a trusted time source among multiple time sources, avoiding the problem of not being able to obtain the correct time when a single time source fails or is abnormal, and can improve the accuracy of obtaining the time of the vehicle-mounted device.

[0008] In one possible design, the vehicle-mounted device determines a target time source among the at least two time sources based on the time sent by each of the at least two time sources, including: the vehicle-mounted device determines a time trust factor for each of the at least two time sources; the vehicle-mounted device takes the time source with the highest time trust factor among the at least two time sources as the target time source.

[0009] Through the above technical solution, the vehicle-mounted equipment can calculate the credibility of multiple time sources during vehicle driving, that is, determine the time credibility factor of each time source, and then obtain the most credible time source based on the time credibility factor, so as to obtain more accurate time.

[0010] It should be noted that different time sources may have different methods for calculating the time trust factor. For example, when the server is used as the time source, the vehicle-mounted device can determine whether the server can feed back the time, and then determine whether the vehicle-mounted device can communicate normally with the background based on the feedback time, thereby determining whether the server time is trustworthy. For another example, when the vehicle includes multiple ECUs, the vehicle-mounted device can obtain time from the ECU. For example, ECU1 on the vehicle is an ECU specifically used to record time. Then the vehicle-mounted device can consider the time obtained from ECU1 to be more trustworthy, and the time trust factor when ECU1 is used as the time source can be set to 0.9, or 1, etc. This application does not limit this.

[0011] In a possible design, the vehicle-mounted device determines a target time source among the at least two time sources based on the time sent by each of the at least two time sources, including: the vehicle-mounted device obtains the initial time credibility of each of the at least two time sources, and determines the time credibility factor of each of the at least two time sources; the vehicle-mounted device determines the credibility value of each of the at least two time sources based on the initial time credibility, the time credibility factor and the normalized variance of the time sent by each time source; the vehicle-mounted device determines the time source with the largest credibility value among the credibility values ​​of the at least two time sources as the target time source.

[0012] In a possible design, the credible value can be calculated according to the following formula:

[0013]

[0014] Among them, Δi is the normalized variance, Xi is the initial time credibility, λi is the time credibility factor of the time source, μ is the variance factor, μ∈[0,1], and μ is the ratio of the number of time sources that meet the set conditions in the at least two time sources to the total number of time sources.

[0015] It should be understood that when μ=1, it can be considered that the time difference between at least two time sources is small, that is, the time of at least two time sources is relatively close.

[0016] It should be noted that when calculating μ, the time of at least two time sources can be sorted first, and then the time difference between two adjacent times can be calculated in sequence. If the time difference between two adjacent times is less than the set threshold, it means that the time sources corresponding to the two times meet the set conditions. For example, there are 4 time sources in total, and the times after sorting the 4 time sources are: T1, T2, T3, T4. If T2-T1 is less than the set threshold, it means that the time sources corresponding to T1 and T2 meet the set conditions. Assuming that T2-T1 is less than the set threshold, T2-T3 is less than the set threshold, and T3-T4 is greater than the set threshold, it means that the number of time sources that meet the set conditions is 3, so μ = 3 / 4 = 0.75.

[0017] Through the above technical solution, the vehicle-mounted device can calculate the trust value of each time source based on the initial time trustworthiness of each time source and the actual time trustworthiness factor. It should be noted that in the embodiment of the present application, after obtaining the time feedback from each time source, the vehicle-mounted device can eliminate abnormal time from multiple times through the above formula, thereby selecting the time source with the highest trustworthiness.

[0018] In one possible design, the vehicle-mounted device obtains the initial time credibility of each of the at least two time sources, including: the vehicle-mounted device obtains the initial priority of the at least two time sources; the vehicle-mounted device determines the initial time credibility of the at least two time sources based on the initial priority.

[0019] Through the above technical solution, the vehicle-mounted device can set initial priorities for multiple time sources, and set initial time credibility for multiple time sources based on the initial priorities. It should be understood that the setting of the initial priority in the embodiment of the present application is not specifically limited, and the initial priority can be set or not. Of course, the same or different priorities can also be set for multiple time sources.

[0020] In one possible design, the method also includes: the vehicle-mounted device obtains the initial time according to the initial time credibility; the vehicle-mounted device performs time synchronization according to the time of the target time source, including: if the vehicle-mounted device determines that the initial time is less than a set threshold, then the initial time is switched to the time of the target time source.

[0021] Through the above technical solution, the vehicle-mounted equipment can switch to a time source with a high degree of trust, namely, the target time source, when the initial time is lower than a certain threshold. Compared with the solution in the prior art that relies on a single time source, the method of the present application can avoid the problem that the vehicle-mounted equipment cannot update the time in time when a single time source fails or anomalies.

[0022] In one possible design, the at least two time sources include: a global navigation satellite system (GNSS) receiver, a server, a base station, and an electronic control unit (ECU).

[0023] It should be noted that in the embodiment of the present application, the vehicle-mounted device can obtain time from the GNSS receiver, server, base station, and ECU, and then select the most reliable time source from these four time sources so that the vehicle-mounted device can perform time synchronization. It should be understood that the number of time sources in the embodiment of the present application can also be 5 or more, etc., and this application does not make specific limitations.

[0024] In a second aspect, the present application also provides a vehicle-mounted device, which includes a processor; a memory and a computer program; wherein the computer program is stored in the memory, and the computer program includes instructions, and when the instructions are called and executed by the processor, the vehicle-mounted device executes the above-mentioned first aspect and any possible design of the technical solution of the first aspect.

[0025] In the third aspect, the present application also provides a vehicle-mounted device, which includes modules / units for executing the first aspect or any possible design method of the first aspect; these modules / units can be implemented through hardware, or corresponding software can be implemented through hardware.

[0026] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program runs on a vehicle-mounted device, the vehicle-mounted device executes the technical solution of the first aspect of the embodiment of the present application and any possible design of the first aspect.

[0027] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a vehicle-mounted device, the vehicle-mounted device executes the technical solution of the first aspect of the embodiment of the present application and any possible design of the first aspect.

[0028] For each aspect from the second to the fifth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1A A system architecture diagram provided for an embodiment of the present application;

[0030] Figure 1B A schematic diagram of a communication system provided in an embodiment of the present application;

[0031] Figure 2 A schematic diagram of the hardware structure of a vehicle-mounted device provided in an embodiment of the present application;

[0032] Figure 3 A flow chart of a time synchronization method provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of an operation of starting a vehicle provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of a user interface for starting a vehicle provided in an embodiment of the present application;

[0035] Figure 6 A flow chart of a method for determining a target time source provided in an embodiment of the present application;

[0036] Figure 7 A schematic diagram of locating a GNSS receiver provided in an embodiment of the present application;

[0037] Figure 8 A schematic diagram of the structure of another vehicle-mounted device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The at least one involved in the embodiments of the present application includes one or more; wherein, more means greater than or equal to two. In addition, it should be understood that in the description of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0039] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one or more (including two); "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0040] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0041] Below, some terms in the embodiments of the present application are first explained to facilitate understanding by those skilled in the art.

[0042] 1) In-vehicle devices: Any device placed or installed on a vehicle can be considered an in-vehicle device. In-vehicle devices can include devices that are factory-installed on the vehicle by the vehicle manufacturer before the vehicle leaves the factory, as well as devices that are installed or placed in the vehicle by the user after the vehicle is sold. For example: a car box (T-BOX), a car computer (for example, Huawei HiCar), a smart rearview mirror, a car microphone, a car speaker, an electronic control unit (ECU), etc. can all be considered as in-vehicle devices.

[0043] Among them, the telematics box (T-BOX) is mainly used to communicate with the background system / mobile phone application (APP) to realize the vehicle information display and control of the mobile phone APP. When the user sends a control command through the mobile phone APP, the background will send a monitoring request instruction to the vehicle-mounted T-BOX. After the vehicle obtains the control command, it sends a control message through the controller area network (CAN) bus and realizes the control of the vehicle. Finally, the operation result is fed back to the user's mobile phone APP. Only this function can help users remotely start the vehicle, turn on the air conditioner, adjust the seat to a suitable position, etc. It should be understood that the background can also be called a server, a background server, etc., which can be used to remotely activate and start the vehicle and perform corresponding authentication. The server can be a cloud server.

[0044] Car computer refers to the abbreviation of the in-vehicle infotainment product installed in the car. The car computer can realize information communication between people and cars, and between cars and the outside world (cars and cars).

[0045] Electronic Control Unit ECU, also known as "driving computer", "on-board computer", etc. It should be understood that a vehicle may include multiple ECUs.

[0046] As an example but not limitation, in the embodiments of the present application, the vehicle-mounted device placed or installed on the vehicle may also include a wearable device. Wearable devices may also be referred to as wearable smart devices or smart wearable devices, etc., which are a general term for the application of wearable technology to intelligently design and develop wearable devices for daily wear, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only a kind of hardware device, but also realize powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and can realize complete or partial functions without relying on smartphones, such as smart watches or smart glasses, etc., as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets, smart helmets, and smart jewelry for vital sign monitoring.

[0047] 2) Controller Area Network (CAN) bus: A multi-master bus system, initially developed by Bosch in Germany, and eventually became an international standard (ISO11519), and is one of the most widely used field buses in the world. According to the CAN communication matrix of car companies, the mileage, oil temperature, tire pressure, doors, windows, air conditioning and other parameter information of the vehicle can be obtained through the CAN bus on the vehicle. In addition, data transmission between multiple ECUs in the automotive electronic system can be transmitted through the CAN bus.

[0048] 3) Global Navigation Satellite System (GNSS): usually includes the global positioning system (GPS), Beidou navigation satellite system (BDS), global navigation satellite system (GLONASS), Galileo satellite navigation system (Galileo), etc. GNSS system can provide precise positioning, navigation and timing services. In addition, GNSS is a high-precision clock source with an accuracy of microseconds.

[0049] 4) Network Time Protocol (NTP): enables the device to obtain the time provided by the server by connecting to the NTP server.

[0050] 5) Network identity and time zone (NITZ): During the access process of a mobile user's SIM card, the operator sends time and other information to the user's mobile device through the exchange of messages between the SIM card and the base station (carrying the operator's identity and the user's time, time zone, daylight saving time, etc.). The mobile device can perform time calibration based on this information.

[0051] 6) The National Marine Electronics Association (NMEA): The NMEA protocol is a set of communication protocols developed by the National Marine Electronics Association of the United States to establish a unified BTCM (Technical Commission for Maritime Radio) standard in different GNSS navigation devices. The GNSS receiver transmits information such as position and speed to PCs, PDAs and other devices through the serial port according to the standard specifications of the NMEA-0183 protocol.

[0052] At present, in-vehicle devices usually obtain time from a server and then synchronize time based on the time fed back by the server. This time synchronization method relies on the server. If the server is abnormal or fails, the in-vehicle device may not be able to obtain accurate time, which in turn affects the function of the in-vehicle device.

[0053] In view of this, an embodiment of the present application provides a time synchronization method, which obtains time from multiple time sources, and then determines a time source with the highest degree of trust among the multiple time sources. The vehicle-mounted device then synchronizes time according to the time of the most trustworthy time source, so that when the time of the vehicle-mounted device is abnormal, it switches to the most trustworthy time source to ensure the accuracy of the time on the vehicle-mounted device.

[0054] First, the application scenarios of the embodiments of the present application are introduced. Figure 1A As shown in FIG. 1 , a system architecture diagram is provided in an embodiment of the present application. Figure 1A In the schematic diagram shown, the system architecture may include a vehicle and a terminal device. The vehicle may include an onboard device, and the onboard device may include an ECU. Figure 1A The figure shows a wireless communication connection between the ECU and the vehicle-mounted devices other than the ECU, but the ECU and the vehicle-mounted devices other than the ECU can also be connected through wired communication such as CAN bus / vehicle Ethernet / UART. This application does not limit this. In some embodiments, the vehicle-mounted device can be connected to an external terminal device (for example, a mobile phone) to achieve interconnection between the mobile phone and the vehicle-mounted device, so that data on the mobile phone can be transmitted to the vehicle-mounted device.

[0055] For example, for ECUs on the vehicle CAN bus (such as a vehicle-mounted T-BOX) and embedded ECUs inside the vehicle that need to be collected, the CAN bus can be used to communicate with the on-board devices; for entertainment systems inside the vehicle, such as the vehicle's central control screen or rear seat entertainment display screens, USB or Ethernet physical connections can be used to communicate with the on-board devices, or wireless communications using shared wireless fidelity (Wi-Fi) hotspots can be used for communication.

[0056] In the embodiment of the present application, the terminal device may refer to a device that provides voice and / or data connectivity to a user. For example, it may include a handheld device with a wireless connection function, or a processing device connected to a wireless modem. The terminal device may communicate with the core network via a radio access network (RAN) and exchange voice and / or data with the RAN. The terminal device may include user equipment (UE), mobile station (MS), mobile terminal device (MT), wireless terminal device, device-to-device (D2D) terminal device, vehicle to everything (V2X) terminal device, machine-to-machine / machine-type communications (M2M / MTC) terminal device, Internet of Things (IoT) terminal device, subscriber unit, subscriber station, mobile station, remote station, access point (AP), remote terminal device, access terminal device, user terminal, user agent, or user device, etc. For example, it may include a mobile phone (or "cellular" phone), a computer with a mobile terminal device, a portable, pocket-sized, handheld, or computer-built-in mobile device, etc. For example, personal communication service (PCS) phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDA), and other devices. It also includes limited devices, such as devices with low power consumption, or devices with limited storage capacity, or devices with limited computing power, etc. For example, it includes information sensing devices such as barcodes, radio frequency identification (RFID), sensors, global positioning systems (GPS), laser scanners, etc.At present, some examples of terminal devices are: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in self driving, wireless terminal devices in remote medical surgery, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, wireless terminal devices in smart homes, etc.

[0057] It should be understood that Figure 1A The description is only given using one ECU as an example. In actual applications, a vehicle may include more ECUs, and this application does not limit this.

[0058] like Figure 1B FIG. 1 is a schematic diagram of a communication system provided in an embodiment of the present application. Figure 1B In the schematic diagram shown, the communication system may include a time source (specifically, an ECU, a GNSS receiver, a server, a base station), and a vehicle. It should be understood that Figure 1B Here, only four time sources are used as an example, and the number of time sources is not limited in the embodiment of the present application. The vehicle may include an on-board device, a GNSS receiver (or wireless receiver, wireless communication module), and the on-board device may include an ECU.

[0059] In the communication system, a connection can be established between the time source and the vehicle-mounted device through a communication network, and then the communication network can be used to transmit data. For example, data can be transmitted through a wireless communication network, a CAN bus, an in-vehicle Ethernet, etc. In the embodiment of the present application, the satellite can periodically broadcast the vehicle's location information and the vehicle's driving time information, and the GNSS receiver on the vehicle-mounted device can receive the vehicle's location information and the vehicle's driving time information broadcast by the satellite.

[0060] Accordingly, the vehicle-mounted device can obtain time from the GNSS receiver / server / base station / ECU, and then the vehicle-mounted device can calculate the credibility of different time sources, select the most credible time source, and finally synchronize the time of the most credible time source to the local time of the vehicle-mounted device. The specific calculation process of the time source credibility will be described in detail below, and will not be explained here.

[0061] It should be noted that the server in the embodiment of the present application may be a single server or a server cluster, and the present application does not make any specific limitation on this.

[0062] An embodiment of the present application provides a time synchronization method, which is applicable to vehicle-mounted equipment. Figure 2 A possible hardware structure diagram of the vehicle-mounted device is shown. Figure 2 As shown, the vehicle-mounted device 100 includes: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a bus 140, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a display screen 180, and a subscriber identification module (SIM) card interface 190, etc.

[0063] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may be the nerve center and command center of the vehicle-mounted device 100. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. The memory may store instructions or data that have just been used or cyclically used by the processor 110. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In the embodiment of the present application, the processor 110 is used to determine and process the collected time information. For example, the processor 110 can determine whether the collected time information is credible. And when it is determined that the credibility of the time information is low, the time information with low credibility can be eliminated.

[0064] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the vehicle-mounted device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing files such as pictures and videos in the external memory card.

[0065] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the vehicle-mounted device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, and software code of at least one application (such as iQiyi application, WeChat application, etc.). The data storage area can store data (such as images, videos, etc.) generated during the use of the vehicle-mounted device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0066] The USB interface 130 is an interface that complies with USB standard specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the vehicle-mounted device 100, and may also be used to transmit data between the vehicle-mounted device 100 and peripheral devices.

[0067] The bus 140 may include a CAN bus, an in-vehicle Ethernet, or a universal asynchronous receiver transmitter (UART) bus. In the embodiment of the present application, data may be transmitted via the bus 140 .

[0068] The wireless communication function of the vehicle-mounted device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the vehicle-mounted device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna. For example, antenna 1 can be reused as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0069] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G and future communication systems, such as the sixth generation (6G) system, applied to the vehicle-mounted device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0070] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), GNSS, frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the vehicle-mounted device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0071] In some embodiments, the antenna 1 of the vehicle-mounted device 100 is coupled to the mobile communication module 140, and the antenna 2 is coupled to the wireless communication module 160, so that the vehicle-mounted device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE) system, BT, GNSS, WLAN, NFC, FM, and / or IR technology.

[0072] The vehicle-mounted device 100 can implement audio functions such as music playing and recording through the audio module 170 and the application processor.

[0073] The display screen 180 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the vehicle-mounted device 100 may include 1 or N display screens 180, where N is a positive integer greater than 1. In an embodiment of the present application, the display screen 180 may be used to display time information.

[0074] The SIM card interface 190 is used to connect a SIM card. The SIM card can be connected to and separated from the vehicle-mounted device 100 by inserting the SIM card interface 190 or pulling the SIM card interface 190 out. It should be understood that in the embodiment of the present application, an eSIM card can also be embedded in the vehicle-mounted device 100, and the present application does not limit this. In the embodiment of the present application, the vehicle-mounted device can obtain time from the base station through the SIM card interface or the eSIM card during the vehicle driving process.

[0075] Understandably, Figure 2 The components shown do not constitute a specific limitation on the vehicle-mounted device 100. The vehicle-mounted device 100 may also include more or fewer components than shown in the figure. For example, the vehicle-mounted device 100 may also include a sensor module, a headphone jack, a speaker, etc., or combine certain components, or split certain components, or arrange the components differently.

[0076] It should be noted that the solution of the embodiment of the present application is not limited to vehicle-mounted equipment, but can also be applied to other equipment with multiple time sources, and the present application does not limit this.

[0077] The present application provides a time synchronization method, which can be applied to Figure 1B The structure of the vehicle-mounted device involved in the embodiment of the present application can be as follows Figure 2 The structure of the vehicle-mounted device 100 shown in the figure may also be other structures, which are not limited in the present application. Figure 3 FIG. 1 is a flow chart of a time synchronization method provided in an embodiment of the present application, and the method comprises the following steps:

[0078] S301: The in-vehicle device receives a first operation.

[0079] In an embodiment of the present application, the first operation may be a click operation of a start switch button on the vehicle by a user, or may be a start operation triggered by a user on a mobile phone APP.

[0080] For example, see Figure 4 As shown, the user is sitting in the car. Assuming that the start switch button on the car is 401, the user can click the start switch button 401 to ignite the vehicle and start the vehicle.

[0081] For another example, see Figure 5As shown, the user can enter the account information on the login interface of the car factory App on the mobile phone to log in to the car factory App. The user's account information can be the account information after being authenticated by the vehicle's server. In response to the user's input operation of the account information, the mobile phone can initiate a verification request to the server corresponding to the car factory App (for example, the vehicle's server). After the user's account and password are successfully verified, the mobile phone receives the verification success response returned by the server and displays the login success interface on the car factory App. For example, the mobile phone displays interface 500, for example Figure 5 The interface 500 may include a "Bluetooth Key" page 501; Figure 5 As shown in a, the "Bluetooth Key" page 501 includes a "Bluetooth" icon, a "Non-Sense Operation Settings" button 502, etc. Among them, the "Bluetooth" icon is used to set up or disconnect the Bluetooth connection, and the "Non-Sense Operation Settings" button 502 is used to control a specific function that the vehicle automatically performs.

[0082] The user may click the “non-contact operation setting” button 502, and the mobile phone may display a “non-contact operation setting” interface 510 on the display screen in response to the user clicking the “non-contact operation setting” button 502, for example Figure 5 As shown in b in FIG. Among them, the interface 510 may include buttons such as "unlock door", "lock door", "open trunk", "ignition", "raise window", and "lower window". The user can click any of the buttons to set the function corresponding to the button to be automatically executed. For example, when the user clicks the "ignition" button 511, the mobile phone can receive the user's click operation on the "ignition" button 511, and the server sets the vehicle startup function to be automatically executed according to the instruction of the mobile phone. After the vehicle receives the execution command of a specific function sent by the server, it automatically starts the vehicle.

[0083] It should be understood that the mobile phone and the car key can complete the registration and pairing of the vehicle through Bluetooth, and usually after the vehicle is sold, the salesperson will ask the car owner to install a car manufacturer application (application, APP) on the mobile phone and ask the car owner to register a user account on the car manufacturer APP.

[0084] S302: The in-vehicle device responds to the first operation and sends a time synchronization request message to at least two time sources.

[0085] S303: The in-vehicle device receives a time synchronization response message sent by at least two time sources.

[0086] The time synchronization response message may include the time of at least two time sources.

[0087] S304: The vehicle-mounted device determines a target time source according to the time of at least two time sources.

[0088] In an embodiment of the present application, the vehicle-mounted device may calculate the credibility of at least two time sources through the time of at least two time sources, and then use the time source with the highest credibility as the target time source.

[0089] The following is a detailed description of step S304. Figure 6 As shown, it is a flow chart of a method for determining a target time source provided by an embodiment of the present application, see Figure 6 As shown, the method may include the following steps:

[0090] S601: The vehicle-mounted device obtains the initial time credibility of at least two time sources.

[0091] In some embodiments, the vehicle-mounted device can set the initial time credibility for at least two time sources. Figure 1B The four time sources in the schematic diagram are used as an example for introduction. Exemplarily, the initial time credibility can be set for the four time sources, for example, it can be set as follows: the initial time credibility of the GNSS receiver time source (hereinafter referred to as: GNSS time source) is X1 (for example, 100%), the initial credibility of the server time source is X2 (for example, 80%), the initial credibility of the base station time source is X3 (for example, 90%), and the initial credibility of the ECU time source is X4 (for example, 85%).

[0092] As a possible implementation, the vehicle-mounted device may set priorities for at least two time sources. Exemplarily, assuming that the time sources include time source 1, time source 2, time source 3, and time source 4, the priorities of the time sources are: the priority of time source 1 is higher than the priority of time source 2, the priority of time source 2 is higher than the priority of time source 3, and the priority of time source 3 is higher than the priority of time source 4.

[0093] It should be understood that the priority sorting of time sources is not limited to the above examples. For example, the priority of the time sources can also be set to the same priority, etc. This application does not limit this.

[0094] In other embodiments, the vehicle-mounted device can set the initial time credibility for the time source based on the priority of the time source. Exemplarily, it is assumed that the priority of the time source is: priority of GNSS time source>priority of server time source>priority of base station time source>priority of ECU time source. Then, the initial time credibility of the time source can be set as follows: the initial time credibility of the GNSS time source is X1 (for example, 100%), the initial time credibility of the server time source is X2 (for example, 90), the initial time credibility of the base station time source is X3 (for example, 85%), and the initial time credibility of the ECU time source is X4 (for example, 80%).

[0095] It should be understood that the above-mentioned initial time credibility set for the time source is only an illustrative description, and the embodiments of the present application are not limited to the above-mentioned examples.

[0096] S602: The vehicle-mounted device determines time trust factors of at least two time sources.

[0097] The following introduces the process of determining the time credibility factors of the four time sources respectively.

[0098] (1) GNSS time source

[0099] In the embodiment of the present application, the satellite may periodically broadcast its own location information. After the GNSS receiver on the vehicle-mounted device receives the location information broadcast by the GNSS, the location information of the GNSS receiver may be calculated by the location information broadcast by the satellite. Then, the GNSS receiver of the vehicle-mounted device may calculate the vehicle's travel speed, such as V0, based on the location information of the GNSS receiver and the vehicle's travel time information. It should be noted that the number of satellites in the embodiment of the present application may be at least two.

[0100] The calculation process of the vehicle's running speed V0 is introduced below.

[0101] like Figure 7 FIG. 1 is a schematic diagram of a method for locating a GNSS receiver according to an embodiment of the present application. Figure 7 The schematic diagram shown may include four satellites, such as satellite 1, satellite 2, satellite 3 and satellite 4, the position of the GNSS receiver is the position to be calculated, and the distances from the four satellites to the GNSS receiver are d1, d2, d3, and d4 respectively.

[0102] Specifically, the four satellites can broadcast their own position coordinate information periodically, for example, broadcast the position coordinate information once every 0.1s, so that the GNSS receiver can obtain the position coordinate information of the four satellites. It should be noted that the position coordinate information of the satellite can be represented by coordinates in a spatial coordinate system (or a three-dimensional coordinate system); for example (X, Y, Z). Among them, X can represent the longitude information of the satellite, Y can represent the latitude information of the satellite, and Z can represent the altitude information of the satellite. The altitude information can be the distance between a certain point (for example, the satellite can be regarded as a point; or the center of mass of the satellite, etc.) and the center of the earth. The origin of the three-dimensional coordinate system can be the center of the earth.

[0103] In some embodiments, the four satellites can carry the timestamp of sending the location coordinate information while broadcasting their own location coordinate information. When the GNSS receiver receives the timestamp of the location coordinate information, it can subtract the time of the timestamp from the current time to obtain the transmission time of the location coordinate information from the satellite to the GNSS receiver. It should be understood that when the satellite broadcasts the location coordinate information, it transmits it via radio waves, and ideally the speed is the speed of light C. Then, the distance from the four satellites to the GNSS receiver is the product of the speed of light and the transmission time. Taking one satellite as an example, for example, the time when satellite 1 broadcasts its own location coordinate information is T1, and the time when the GNSS receiver receives the location coordinate information is T2, then the distance d1 from satellite 1 to the GNSS receiver is (T2-T1)*C.

[0104] In this way, the distances from the four satellites to the GNSS receiver can be calculated, and then the position of the GNSS receiver can be calculated through the distances from the four satellites to the GNSS receiver and the position coordinate information of the four satellites. The specific implementation of this process can be referred to the existing technology, and no further details will be given here.

[0105] When a vehicle is driving, the vehicle's speed can be calculated by the displacement of the GNSS receiver over a period of time and the vehicle's driving time. For example, the position of the GNSS receiver at time T1 is S1, and the position at time T2 is S2, that is, from T1 to T2, the vehicle's displacement is: ΔS = S2-S1, and the vehicle's driving time is: ΔT = T2-T1. Then the vehicle's driving speed V0 is: V0 = ΔS / ΔT.

[0106] It should be understood that the position coordinate information and the like sent by the satellite that can be received by the GNSS receiver is sent to the processing module on the GNSS receiver in a fixed data format, namely, the NMEA sentence format, so that the processing module on the GNSS receiver can calculate the speed and the like.

[0107] In a possible implementation, in an embodiment of the present application, the vehicle's driving speed V0 calculated by the GNSS receiver can be compared with the vehicle's own driving speed (such as V1), and whether the GNSS time source is credible can be determined by comparing the difference between the two driving speeds.

[0108] It should be noted that this application only uses speed as an example. In actual applications, the vehicle's own mileage information, position offset information at different time points, average fuel consumption, etc. can all be used as parameters to calculate whether the time source is reliable. This application does not limit this.

[0109] Exemplarily, when |V1-V0|<Δ, it is determined that the credibility of the GNSS time source is high. In addition, different credibility factors can be given according to the difference between V1 and V0 and the error size of Δ. It should be understood that Δ is pre-set, and for the convenience of description, the credibility factor of the GNSS time source can be recorded as λ1. It should be noted that the vehicle's own driving speed V1 can be obtained by the vehicle-mounted device from the vehicle CAN bus.

[0110] For example, assuming Δ=10, when the values ​​of V1 and V0 are different, the error with Δ is different. For example, for the first set of data: V0=35, V1=40, then |V1-V0|=|40-35|=5<Δ; for the second set of data: for example, V0=35, V1=42, then |V1-V0|=|42-35|=7<Δ.

[0111] Since |40-35|<|42-35|, that is, the error range between |40-35| and Δ is smaller, the credibility factor (also called credibility or credibility) of the first set of data can be set higher than the credibility factor of the second set of data. Exemplarily, the relationship between the credibility factor and the error size can be referred to the following table, such as shown in Table 1.

[0112] Table 1

[0113] Error size 0 5 10 20 Credibility factor λ1 1 0.9 0.7 0

[0114] It should be understood that the above table is only a schematic illustration, and the embodiments of the present application are not limited to the above examples. For example, when the error size is 5, the credibility factor may also be 1, and the present application does not limit this.

[0115] (2) Server time source

[0116] It should be understood that the server in the embodiment of the present application may be an NTP server, or a time server, etc.

[0117] In the embodiment of the present application, it can be determined whether the vehicle-mounted device can obtain the time from the server and, after obtaining the time, whether the obtained time is within the validity period of the server's certificate.

[0118] Specifically, the vehicle-mounted device may send a time synchronization request message to the server to obtain the time on the server. Correspondingly, after receiving the time synchronization request message, the server may feed back a time synchronization response message to the vehicle-mounted device, and the time synchronization response message may include the server time.

[0119] If the vehicle-mounted device can receive the time synchronization response message, and the time synchronization response message carries the server's time, it means that the vehicle-mounted device can obtain the time from the server. Then, the vehicle-mounted device can determine whether the time obtained from the server is within the validity period of the server's certificate.

[0120] It should be understood that there is a certificate on the server, which has a validity period, that is, the certificate validity period. If the time fed back by the server is within the validity period of the certificate, it means that the vehicle can communicate normally with the backend server; if the time fed back by the server is not within the validity period of the certificate, it means that the vehicle cannot communicate normally with the backend server.

[0121] For the convenience of description, the trust factor of the server time source can be recorded as λ2. For the trust factor of the server time source, if the vehicle-mounted device can obtain the time from the server, and the obtained time is within the validity period of the server certificate, it means that the trustworthiness of the server is relatively high. For example, λ2 can be set to 0.9. Of course, λ2 can also be other values, which are not limited in this application.

[0122] (3) Base station time source

[0123] In an embodiment of the present application, the time when the vehicle crosses different cell ranges can be obtained through the SIM card on the vehicle-mounted device. Assuming that the time when the vehicle enters cell 1 is T1, and the time when the vehicle leaves cell 2 is T2, it can be determined whether the base station time source is credible by comparing the difference between T1 and T2. Exemplarily, when T2-T1<θ, it can be considered that the credibility of the base station time source is relatively high. For example, when T2-T1<1min, it can be considered that the credibility of the base station time source is relatively high.

[0124] For the convenience of description, the trust factor of the base station time source can be recorded as λ3. For the trust factor of the base station time source, in the embodiment of the present application, the trust factor can be determined by the error between T2-T1 and θ. For example, when the error between T2-T1 and θ is large, a smaller trust factor can be set, and when the error between T2-T1 and θ is small, a larger trust factor can be set. For example, the relationship between the error size and the trust factor λ3 can be found in Table 2 below.

[0125] Table 2

[0126] Error size 0 0.5 1 3 Credibility factor λ3 1 1 0.8 0

[0127] It should be understood that the above table is only a schematic illustration, and the embodiments of the present application are not limited to the above examples. For example, when the error size is 0.5, the credibility factor can also be 0.9, and the present application does not limit this.

[0128] (4) ECU time source

[0129] In the embodiment of the present application, the vehicle-mounted device can obtain the time from the ECU on the vehicle, and then determine the credibility of the ECU time source based on the time obtained from the ECU. For the convenience of description, the credibility factor of the ECU time source can be recorded as λ4 in the embodiment of the present application. For example, if there are multiple ECUs on the vehicle, such as ECU1, ECU2 and ECU3, where ECU1 is an ECU on the vehicle specifically used to record time, then it can be considered that the credibility of ECU1 is higher, for example, the credibility factor of ECU1 can be set to 1, and the credibility factor less than 1 can be set for ECU2 and ECU3.

[0130] Of course, in the embodiment of the present application, there is no limitation on the specific value of the trust factor, and the magnitude relationship among λ1, λ2, λ3 and λ4 is not specifically limited in S303.

[0131] It should be noted that in the embodiment of the present application, λ1, λ2, λ3 and λ4 are not fixed values. During the driving process of the vehicle, as the driving time and mileage of the vehicle increase, λ1, λ2, λ3 and λ4 can be dynamically adjusted.

[0132] It should be understood that in actual applications, step S601 and step S602 may be performed first, and then S601, or they may be performed simultaneously, etc. This application does not limit this.

[0133] S603: The vehicle-mounted device determines a target time source according to the trust factors of at least two time sources and / or the initial time trustworthiness.

[0134] After obtaining the time trust factors of at least two time sources in S603, a time source for synchronizing the vehicle-mounted device can be selected from the at least two time sources, for example, recorded as a target time source. In the embodiment of the present application, the target time source can be determined by the following possible implementation methods, as follows:

[0135] Mode 1: The vehicle-mounted device may determine the target time source based on the trust factors of at least two time sources. For example, the vehicle-mounted device may compare the trust factors of at least two time sources, and then use the time source with the highest trust factor among the trust factors of at least two time sources as the target time source. For example, if the value of λ2 is the largest among λ1, λ2, λ3 and λ4, the server time source may be used as the target time source.

[0136] Method 2: As a possible implementation method, in the embodiment of the present application, the time sources with low time credibility can be eliminated by probability theory, and then the target time source is selected from the time sources with high credibility. The following specifically describes how to eliminate the time sources with low time credibility.

[0137] First, in S303, the time of different time sources can be obtained. Then, in order to identify the difference between different time sources, the variance of the time sources can be calculated. Specifically, the calculation can be performed in the following manner:

[0138]

[0139] Among them, X i Indicates the time obtained by the vehicle-mounted device from at least two time sources. Represents the average of the times from at least two time sources.

[0140] The above formula can be used to calculate the difference between the time obtained from each time source and the average time obtained from at least two time sources. For the convenience of calculation, the variance can be normalized, for example, by the following formula:

[0141]

[0142] Generally, the time difference between different time sources is usually within the range of seconds, that is, the time difference is relatively small. In this case, the trust value of each time source can be calculated by the following formula:

[0143]

[0144] That is to say, when the time difference between different time sources is not much different, the formula can be referred to to calculate the credible values ​​of different time sources. In practical applications, there may be a situation where the time difference is relatively large, such as the time of a certain time source is wrong, which may make the time difference range be days or years. In view of this situation, the following method can be used to eliminate abnormal data in the embodiment of the present application.

[0145] In a possible implementation, the vehicle-mounted device can first sort the time obtained from different time sources in chronological order, and then calculate in sequence whether the time difference between two adjacent times is within the first set threshold range, and finally calculate the proportion μ of the time within the first set threshold range. Exemplarily, assuming that the time obtained from different time sources is T1, T2, T3, T4, and the time after sorting in chronological order is: T1, T2, T3, T4, then it can be calculated whether |T1-T2|, |T2-T3|, |T3-T4| are less than the first set threshold (for example, 5 minutes). If the difference between |T1-T2| and |T2-T3| is less than the first set threshold, then μ = the number of time sources that meet the first set threshold / the total number of time sources = 3 / 4 = 0.75. It should be understood that the proportion μ can also be called the variance factor μ.

[0146] In the embodiment of the present application, the above formula for calculating the credibility value may be optimized. For example, the credibility value may be calculated using the following formula.

[0147]

[0148] Further, the variance factor μ can reflect the degree of discreteness of the time obtained from different time sources to a certain extent. Exemplarily, assuming that when the variance factor μ is less than a certain threshold (e.g., recorded as a second threshold, such as 30%), it can be considered that the time obtained from different time sources is relatively discrete, and the variance factor μ can be set to 0. In some embodiments, the value of the ratio μ can refer to the following table.

[0149] Table 3

[0150] Ratio within the threshold range 100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% Variance factor μ 1 1 0.8 0.6 0.4 0.2 0.1 0 0 0 0

[0151] It should be noted that the calculation method of the credible value involved in the embodiments of the present application is not limited to the above examples. For example, when calculating the credible value, the credible value can also be determined by multiplying the initial credible value by the credible factor, that is, credible value = initial credible value Xi * credible factor λi, or the credible value can also be determined by normalized variance, that is, Of course, the above formula may also be multiplied by a certain weight, etc. In the embodiment of the present application, as long as the credibility of multiple time sources can be compared, various variations of the formula are included in the protection scope of the present application.

[0152] S305: The vehicle-mounted device synchronizes the time of the vehicle-mounted device according to the time of the target time source.

[0153] In the embodiment of the present application, after the vehicle-mounted device determines the most credible time source among at least two time sources, namely the target time source, the time of the vehicle-mounted device can be synchronized according to the time of the target time source. For example, assuming that the most credible time source determined among the GNSS time source, the server time source, the base station time source, and the ECU time source is the server time source, the vehicle-mounted device can synchronize the time of the vehicle-mounted device according to the time of the server time source.

[0154] Furthermore, after S305, during the subsequent driving of the vehicle, the on-board equipment can periodically obtain time from at least two time sources, and then calculate the time credibility of at least two time sources, and determine whether the time source with the highest time credibility is still the target time source in S305, so as to avoid the situation where the target time source has an abnormality during the driving of the vehicle, resulting in an error in the time of the on-board equipment.

[0155] In the above embodiments provided by the present application, the method provided by the embodiment of the present application is introduced from the perspective of the vehicle-mounted device as the execution subject. In order to realize the various functions in the method provided by the above embodiments of the present application, the vehicle-mounted device may include a hardware structure and / or a software module, and realize the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0156] like Figure 8 As shown, some other embodiments of the present application disclose a vehicle-mounted device, see Figure 8 As shown, the vehicle-mounted device 800 includes: a transceiver 801; one or more processors 802; one or more memories 803; and one or more computer programs 804 (not shown in the figure), and the above-mentioned components can be connected via one or more communication buses 805.

[0157] The transceiver 801 is used to send and receive messages; the memory 803 stores one or more computer programs, and the one or more computer programs include instructions; the processor 802 calls the instructions stored in the memory 803, so that the vehicle-mounted device 800 performs the following steps:

[0158] The transceiver 801 receives a first operation, where the first operation is used to start the vehicle where the vehicle-mounted device is located;

[0159] The processor 802 responds to the first operation and sends a time synchronization request message to at least two time sources through the transceiver 801;

[0160] The transceiver 801 receives a time synchronization response message sent by each of the at least two time sources, where the time synchronization response message includes the time sent by each time source;

[0161] The processor 802 determines a target time source from among the at least two time sources according to the time sent by each of the at least two time sources, wherein the target time source is the time source with the most accurate time among the at least two time sources;

[0162] The processor 802 performs time synchronization according to the time of the target time source.

[0163] In one possible implementation, the vehicle-mounted device 800 is specifically used to determine a target time source among the at least two time sources based on the time sent by each of the at least two time sources in the following manner: determine a time trust factor for each of the at least two time sources; and take the time source with the highest time trust factor among the at least two time sources as the target time source.

[0164] In a possible implementation, the vehicle-mounted device 800 is specifically used to determine a target time source among the at least two time sources according to the time sent by each of the at least two time sources in the following manner: obtain the initial time credibility of each of the at least two time sources, and determine the time credibility factor of each of the at least two time sources; determine the credibility value of each of the at least two time sources according to the initial time credibility, the time credibility factor and the normalized variance of the time sent by each time source; and determine the time source with the largest credibility value among the credibility values ​​of the at least two time sources as the target time source.

[0165] In a possible implementation, the trust value of each of the at least two time sources satisfies the following formula:

[0166]

[0167] Among them, Δi is the normalized variance, Xi is the initial time credibility, λi is the time credibility factor of the time source, μ is the variance factor, μ∈[0,1], and μ is the ratio of the number of time sources that meet the set conditions in the at least two time sources to the total number of time sources.

[0168] In one possible implementation, the vehicle-mounted device 800 is specifically used to obtain the initial time credibility of each of the at least two time sources in the following manner: obtain the initial priority of the at least two time sources; and determine the initial time credibility of the at least two time sources based on the initial priority.

[0169] In a possible implementation, when the instruction is called and executed by the one or more processors 802, the vehicle-mounted device 800 further executes the following steps: the vehicle-mounted device obtains the initial time according to the initial time credibility.

[0170] When the instruction is called and executed by the one or more processors 802, the vehicle-mounted device 800 specifically performs the following steps: if it is determined that the initial time is less than a set threshold, the initial time is switched to the time of the target time source.

[0171] In a possible implementation manner, the at least two time sources include: a global navigation satellite system (GNSS) receiver, a server, a base station, and an electronic control unit (ECU).

[0172] In the embodiment of the present application, the processor 802 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware processor to be executed, or the hardware and software modules in the processor can be combined and executed. The software module can be located in the memory 803, and the processor 802 reads the program instructions in the memory 803, and completes the steps of the above method in combination with its hardware.

[0173] In the embodiment of the present application, the memory 803 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as RAM. The memory may also be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application may also be a circuit or any other device that can implement a storage function, for storing instructions and / or data.

[0174] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0175] Based on the above embodiments, the present application further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the time synchronization method provided in the above embodiments.

[0176] A computer program product is also provided in an embodiment of the present application, including instructions, which, when executed on a computer, enable the computer to execute the time synchronization method provided in the above embodiment.

[0177] The present application embodiment is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the present application embodiment. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow chart and / or box in the flow chart and / or block diagram can be realized by instructions. These instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart or multiple flows and / or one box or multiple boxes of the block diagram.

[0178] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0179] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

Claims

1. A time synchronization method, applied to a vehicle-mounted device, characterized in that: include: The in-vehicle device receives a first operation, where the first operation is used to start the vehicle where the in-vehicle device is located; In response to the first operation, the in-vehicle device sends a time synchronization request message to at least two time sources; The in-vehicle device receives a time synchronization response message sent by each of the at least two time sources, wherein the time synchronization response message includes the time sent by each time source; The vehicle-mounted device determines a target time source from among the at least two time sources according to the time sent by each of the at least two time sources, wherein the target time source is the time source with the most accurate time among the at least two time sources; The vehicle-mounted device performs time synchronization according to the time of the target time source; The vehicle-mounted device determines a target time source from among the at least two time sources according to the time sent by each of the at least two time sources, including: The vehicle-mounted device determines a time credibility factor of each of the at least two time sources; the vehicle-mounted device uses the time source with the highest time credibility factor among the at least two time sources as the target time source; or, The vehicle-mounted device obtains the initial time credibility of each of the at least two time sources, and determines the time credibility factor of each of the at least two time sources; the vehicle-mounted device determines the credibility value of each of the at least two time sources according to the initial time credibility, the time credibility factor and the normalized variance of the time sent by each time source; the vehicle-mounted device determines the time source with the largest credibility value among the credibility values ​​of the at least two time sources as the target time source; The at least two time sources include at least one of a global navigation satellite system GNSS time source, a server time source, a base station time source, and an electronic control unit ECU time source; The trust factor of the GNSS time source is determined based on one or more of the vehicle's driving speed, mileage information, position offset information at different time points, and average fuel consumption; The trust factor of the server time source is determined based on the time when the server time is acquired and the validity period of the certificate of the server; The trust factor of the base station time source is determined based on the time taken by the vehicle to cross different cell ranges; The trust factor of the ECU time source is determined according to whether the ECU is an ECU specifically used for recording time.

2. The method according to claim 1, characterized in that The trust value of each of the at least two time sources satisfies the following formula: Among them, Δi is the normalized variance, Xi is the initial time credibility, λi is the time credibility factor of the time source, μ is the variance factor, μ∈[0,1], and μ is the ratio of the number of time sources that meet the set conditions in the at least two time sources to the total number of time sources.

3. The method according to claim 1, characterized in that The vehicle-mounted device obtains the initial time credibility of each of the at least two time sources, including: The in-vehicle device obtains initial priorities of the at least two time sources; The in-vehicle device determines initial time credibility of the at least two time sources based on the initial priority.

4. The method according to claim 1 or 3, characterized in that: The method further comprises: The vehicle-mounted device obtains the initial time according to the initial time credibility; The vehicle-mounted device performs time synchronization according to the time of the target time source, including: If the in-vehicle device determines that the initial time is less than a set threshold, the initial time is switched to the time of the target time source.

5. A vehicle-mounted device, characterized in that: include: processor; Memory; and a computer program, wherein the computer program is stored in the memory and when the computer program is executed by the processor, the vehicle-mounted device executes the method according to any one of claims 1 to 4.

6. A computer-readable storage medium, characterized in that: The method comprises a computer program, and when the computer program is run on an electronic device, the electronic device executes the method according to any one of claims 1 to 4.

7. A computer program product, characterized in that The method comprises a computer program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Time synchronization method and communication terminal

    CN106452648A

  • Method for determining a period

    CN109804414A